* [PATCH] 2.5.58 stradis.c fixes to make it compile
@ 2003-01-21 1:59 nil
2003-01-21 3:16 ` Alan
0 siblings, 1 reply; 2+ messages in thread
From: nil @ 2003-01-21 1:59 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 734 bytes --]
I've corrected stradis.c in 2.5.58 to compile properly, and
since Linus is out of town, I've attached it to this message
and placed it at the following location as well:
http://www.kernel.org/pub/linux/kernel/people/laredo/stradis-2.5.58.diff
If you actually have this hardware (I haven't gotten any
reports from anyone actually trying to use it with 2.5.x)
please let me know of success or failure. I would have had
this done sooner but I didn't know this was broken since Alan
never bothered to tell me he changed the video device
interface.
-- Nathan Laredo
laredo at gnu dot org
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
[-- Attachment #2: stradis-2.5.58.diff --]
[-- Type: application/octet-stream, Size: 4307 bytes --]
diff -ru linux-2.5.58/drivers/media/video/bttv-driver.c intel-linux-2.5.58/drivers/media/video/bttv-driver.c
--- linux-2.5.58/drivers/media/video/bttv-driver.c Mon Jan 13 21:59:09 2003
+++ intel-linux-2.5.58/drivers/media/video/bttv-driver.c Fri Jan 17 00:48:05 2003
@@ -247,7 +247,7 @@
},{
.v4l2_id = V4L2_STD_PAL_N,
.name = "PAL-N",
- .Fsc 35468950,
+ .Fsc = 35468950,
.swidth = 768,
.sheight = 576,
.totalwidth = 1135,
diff -ru linux-2.5.58/drivers/media/video/stradis.c intel-linux-2.5.58/drivers/media/video/stradis.c
--- linux-2.5.58/drivers/media/video/stradis.c Mon Jan 13 21:59:16 2003
+++ intel-linux-2.5.58/drivers/media/video/stradis.c Fri Jan 17 00:55:35 2003
@@ -241,12 +241,6 @@
}
}
-static void detach_inform(struct saa7146 *saa, int id)
-{
- int i;
- i = saa->nr;
-}
-
static void I2CBusScan(struct saa7146 *saa)
{
int i;
@@ -1323,9 +1317,12 @@
clip_draw_rectangle(clipmap, 0, 0, 1024, -(saa->win.y));
}
-static int saa_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
+static int saa_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long argl)
{
- struct saa7146 *saa = (struct saa7146 *) dev;
+ struct saa7146 *saa = file->private_data;
+ void *arg = (void *)argl;
+
switch (cmd) {
case VIDIOCGCAP:
{
@@ -1809,24 +1806,23 @@
return 0;
}
-static int saa_mmap(struct video_device *dev, const char *adr,
- unsigned long size)
+static int saa_mmap(struct file *file, struct vm_area_struct *vma)
{
- struct saa7146 *saa = (struct saa7146 *) dev;
+ struct saa7146 *saa = file->private_data;
printk(KERN_DEBUG "stradis%d: saa_mmap called\n", saa->nr);
return -EINVAL;
}
-static long saa_read(struct video_device *dev, char *buf,
- unsigned long count, int nonblock)
+static ssize_t saa_read(struct file *file, char *buf,
+ size_t count, loff_t *ppos)
{
return -EINVAL;
}
-static long saa_write(struct video_device *dev, const char *buf,
- unsigned long count, int nonblock)
+static ssize_t saa_write(struct file *file, const char *buf,
+ size_t count, loff_t *ppos)
{
- struct saa7146 *saa = (struct saa7146 *) dev;
+ struct saa7146 *saa = file->private_data;
unsigned long todo = count;
int blocksize, split;
unsigned long flags;
@@ -1945,11 +1941,23 @@
return count;
}
-static int saa_open(struct video_device *dev, int flags)
+static int saa_open(struct inode *inode, struct file *file)
{
- struct saa7146 *saa = (struct saa7146 *) dev;
+ struct saa7146 *saa = NULL;
+ unsigned int minor = minor(inode->i_rdev);
+ int i;
+
+ for (i = 0; i < SAA7146_MAX; i++) {
+ if (saa7146s[i].video_dev.minor == minor) {
+ saa = &saa7146s[i];
+ }
+ }
+ if (saa == NULL) {
+ return -ENODEV;
+ }
+ file->private_data = saa;
- saa->video_dev.busy = 0;
+ //saa->video_dev.busy = 0; /* old hack to support multiple open */
saa->user++;
if (saa->user > 1)
return 0; /* device open already, don't reset */
@@ -1957,29 +1965,37 @@
return 0;
}
-static void saa_close(struct video_device *dev)
+static int saa_release(struct inode *inode, struct file *file)
{
- struct saa7146 *saa = (struct saa7146 *) dev;
+ struct saa7146 *saa = file->private_data;
saa->user--;
- saa->video_dev.busy = 0;
+ //saa->video_dev.busy = 0; /* old hack to support multiple open */
if (saa->user > 0) /* still someone using device */
- return;
+ return 0;
saawrite(0x007f0000, SAA7146_MC1); /* stop all overlay dma */
+ return 0;
}
-/* template for video_device-structure */
-static struct video_device saa_template =
+static struct file_operations saa_fops =
{
.owner = THIS_MODULE,
- .name = "SAA7146A",
- .type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY,
- .hardware = VID_HARDWARE_SAA7146,
.open = saa_open,
- .close = saa_close,
+ .release = saa_release,
+ .ioctl = saa_ioctl,
.read = saa_read,
+ .llseek = no_llseek,
.write = saa_write,
- .ioctl = saa_ioctl,
.mmap = saa_mmap,
+};
+
+/* template for video_device-structure */
+static struct video_device saa_template =
+{
+ .name = "SAA7146A",
+ .type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY,
+ .hardware = VID_HARDWARE_SAA7146,
+ .fops = &saa_fops,
+ .minor = -1,
};
static int configure_saa7146(struct pci_dev *dev, int num)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] 2.5.58 stradis.c fixes to make it compile
2003-01-21 1:59 [PATCH] 2.5.58 stradis.c fixes to make it compile nil
@ 2003-01-21 3:16 ` Alan
0 siblings, 0 replies; 2+ messages in thread
From: Alan @ 2003-01-21 3:16 UTC (permalink / raw)
To: nil; +Cc: Linux Kernel Mailing List
On Tue, 2003-01-21 at 01:59, nil wrote:
> please let me know of success or failure. I would have had
> this done sooner but I didn't know this was broken since Alan
> never bothered to tell me he changed the video device
> interface.
Not me - I handed over the video4linux stuff a long time back. I guess
Gerd didn't know you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-21 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-21 1:59 [PATCH] 2.5.58 stradis.c fixes to make it compile nil
2003-01-21 3:16 ` Alan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).