summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/spca508.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 05:47:42 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 05:47:42 -0300
commitd1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa (patch)
tree551d1ce9ed77fcb5b2763cd8f606b46a043de386 /linux/drivers/media/video/gspca/spca508.c
parent6324f3b71dfb070913efba2306010ae2e0a1df11 (diff)
parente768886b19cdc2ba666bd52faa7797ff4151ced7 (diff)
downloadmediapointer-dvb-s2-d1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa.tar.gz
mediapointer-dvb-s2-d1c3ce25c000fa72c7bfb3b42d88bfbe4f5e37fa.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/sms1xxx
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/gspca/spca508.c')
-rw-r--r--linux/drivers/media/video/gspca/spca508.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/linux/drivers/media/video/gspca/spca508.c b/linux/drivers/media/video/gspca/spca508.c
index a70d51117..a8d611eba 100644
--- a/linux/drivers/media/video/gspca/spca508.c
+++ b/linux/drivers/media/video/gspca/spca508.c
@@ -22,9 +22,6 @@
#include "gspca.h"
-#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
-
MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver");
MODULE_LICENSE("GPL");
@@ -1471,26 +1468,26 @@ static int reg_write(struct usb_device *dev,
/* read 1 byte */
/* returns: negative is error, pos or zero is data */
-static int reg_read(struct usb_device *dev,
+static int reg_read(struct gspca_dev *gspca_dev,
__u16 index) /* wIndex */
{
int ret;
- __u8 data;
- ret = usb_control_msg(dev,
- usb_rcvctrlpipe(dev, 0),
+ ret = usb_control_msg(gspca_dev->dev,
+ usb_rcvctrlpipe(gspca_dev->dev, 0),
0, /* register */
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- (__u16) 0, /* value */
+ 0, /* value */
index,
- &data, 1,
+ gspca_dev->usb_buf, 1,
500); /* timeout */
- PDEBUG(D_USBI, "reg read i:%04x --> %02x", index, data);
+ PDEBUG(D_USBI, "reg read i:%04x --> %02x",
+ index, gspca_dev->usb_buf[0]);
if (ret < 0) {
PDEBUG(D_ERR|D_USBI, "reg_read err %d", ret);
return ret;
}
- return data;
+ return gspca_dev->usb_buf[0];
}
static int write_vector(struct gspca_dev *gspca_dev,
@@ -1513,15 +1510,12 @@ static int sd_config(struct gspca_dev *gspca_dev,
const struct usb_device_id *id)
{
struct sd *sd = (struct sd *) gspca_dev;
- struct usb_device *dev = gspca_dev->dev;
struct cam *cam;
- __u16 vendor;
__u16 product;
int data1, data2;
- vendor = id->idVendor;
product = id->idProduct;
- switch (vendor) {
+ switch (id->idVendor) {
case 0x0130: /* Clone webcam */
/* switch (product) { */
/* case 0x0130: */
@@ -1573,15 +1567,15 @@ static int sd_config(struct gspca_dev *gspca_dev,
* prove that we can communicate with the device. This works, which
* confirms at we are communicating properly and that the device
* is a 508. */
- data1 = reg_read(dev, 0x8104);
- data2 = reg_read(dev, 0x8105);
+ data1 = reg_read(gspca_dev, 0x8104);
+ data2 = reg_read(gspca_dev, 0x8105);
PDEBUG(D_PROBE, "Webcam Vendor ID: 0x%02x%02x", data2, data1);
- data1 = reg_read(dev, 0x8106);
- data2 = reg_read(dev, 0x8107);
+ data1 = reg_read(gspca_dev, 0x8106);
+ data2 = reg_read(gspca_dev, 0x8107);
PDEBUG(D_PROBE, "Webcam Product ID: 0x%02x%02x", data2, data1);
- data1 = reg_read(dev, 0x8621);
+ data1 = reg_read(gspca_dev, 0x8621);
PDEBUG(D_PROBE, "Window 1 average luminance: %d", data1);
cam = &gspca_dev->cam;
@@ -1749,7 +1743,7 @@ static void getbrightness(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
- sd->brightness = reg_read(gspca_dev->dev, 0x8651);
+ sd->brightness = reg_read(gspca_dev, 0x8651);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
@@ -1819,7 +1813,7 @@ static int __init sd_mod_init(void)
{
if (usb_register(&sd_driver) < 0)
return -1;
- PDEBUG(D_PROBE, "v%s registered", version);
+ PDEBUG(D_PROBE, "registered");
return 0;
}
static void __exit sd_mod_exit(void)