git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
drivers
/
media
/
video
/
pms.c
diff --git
a/drivers/media/video/pms.c
b/drivers/media/video/pms.c
index
d127e29
..
2504207
100644
(file)
--- a/
drivers/media/video/pms.c
+++ b/
drivers/media/video/pms.c
@@
-68,6
+68,7
@@
static int standard = 0; /* 0 - auto 1 - ntsc 2 - pal 3 - secam */
static int io_port = 0x250;
static int data_port = 0x251;
static int mem_base = 0xC8000;
static int io_port = 0x250;
static int data_port = 0x251;
static int mem_base = 0xC8000;
+static void __iomem *mem;
static int video_nr = -1;
static int video_nr = -1;
@@
-629,7
+630,6
@@
static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
{
int y;
int dw = 2*dev->width;
{
int y;
int dw = 2*dev->width;
- u32 src = mem_base;
char tmp[dw+32]; /* using a temp buffer is faster than direct */
int cnt = 0;
char tmp[dw+32]; /* using a temp buffer is faster than direct */
int cnt = 0;
@@
-644,14
+644,14
@@
static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int
for (y = 0; y < dev->height; y++ )
{
for (y = 0; y < dev->height; y++ )
{
-
isa_writeb(0, src
); /* synchronisiert neue Zeile */
+
writeb(0, mem
); /* synchronisiert neue Zeile */
/*
* This is in truth a fifo, be very careful as if you
* forgot this odd things will occur 8)
*/
/*
* This is in truth a fifo, be very careful as if you
* forgot this odd things will occur 8)
*/
-
isa_memcpy_fromio(tmp, src
, dw+32); /* discard 16 word */
+
memcpy_fromio(tmp, mem
, dw+32); /* discard 16 word */
cnt -= dev->height;
while (cnt <= 0)
{
cnt -= dev->height;
while (cnt <= 0)
{
@@
-865,7
+865,7
@@
static int pms_ioctl(struct inode *inode, struct file *file,
return video_usercopy(inode, file, cmd, arg, pms_do_ioctl);
}
return video_usercopy(inode, file, cmd, arg, pms_do_ioctl);
}
-static
in
t pms_read(struct file *file, char __user *buf,
+static
ssize_
t pms_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct video_device *v = video_devdata(file);
size_t count, loff_t *ppos)
{
struct video_device *v = video_devdata(file);
@@
-896,7
+896,7
@@
static struct video_device pms_template=
.fops = &pms_fops,
};
.fops = &pms_fops,
};
-struct pms_device pms_device;
+st
atic st
ruct pms_device pms_device;
/*
/*
@@
-918,16
+918,22
@@
static int init_mediavision(void)
0x34,0x0A,0xF4,0xCE,
0xE4
};
0x34,0x0A,0xF4,0xCE,
0xE4
};
+
+ mem = ioremap(mem_base, 0x800);
+ if (!mem)
+ return -ENOMEM;
if (!request_region(0x9A01, 1, "Mediavision PMS config"))
{
printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n");
if (!request_region(0x9A01, 1, "Mediavision PMS config"))
{
printk(KERN_WARNING "mediavision: unable to detect: 0x9A01 in use.\n");
+ iounmap(mem);
return -EBUSY;
}
if (!request_region(io_port, 3, "Mediavision PMS"))
{
printk(KERN_WARNING "mediavision: I/O port %d in use.\n", io_port);
release_region(0x9A01, 1);
return -EBUSY;
}
if (!request_region(io_port, 3, "Mediavision PMS"))
{
printk(KERN_WARNING "mediavision: I/O port %d in use.\n", io_port);
release_region(0x9A01, 1);
+ iounmap(mem);
return -EBUSY;
}
outb(0xB8, 0x9A01); /* Unlock */
return -EBUSY;
}
outb(0xB8, 0x9A01); /* Unlock */
@@
-950,6
+956,7
@@
static int init_mediavision(void)
if(idec == 0) {
release_region(io_port, 3);
release_region(0x9A01, 1);
if(idec == 0) {
release_region(io_port, 3);
release_region(0x9A01, 1);
+ iounmap(mem);
return -ENODEV;
}
return -ENODEV;
}
@@
-1029,9
+1036,9
@@
static int __init init_pms_cards(void)
return video_register_device((struct video_device *)&pms_device, VFL_TYPE_GRABBER, video_nr);
}
return video_register_device((struct video_device *)&pms_device, VFL_TYPE_GRABBER, video_nr);
}
-
MODULE_PARM(io_port,"i"
);
-
MODULE_PARM(mem_base,"i"
);
-
MODULE_PARM(video_nr,"i"
);
+
module_param(io_port, int, 0
);
+
module_param(mem_base, int, 0
);
+
module_param(video_nr, int, 0
);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
@@
-1045,6
+1052,7
@@
static void __exit cleanup_pms_module(void)
{
shutdown_mediavision();
video_unregister_device((struct video_device *)&pms_device);
{
shutdown_mediavision();
video_unregister_device((struct video_device *)&pms_device);
+ iounmap(mem);
}
module_init(init_pms_cards);
}
module_init(init_pms_cards);