summaryrefslogtreecommitdiff
path: root/drivers/media/usb/gspca/stv06xx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/gspca/stv06xx')
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx.c76
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx.h2
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c10
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c23
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c2
-rw-r--r--drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c16
6 files changed, 69 insertions, 60 deletions
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx.c b/drivers/media/usb/gspca/stv06xx/stv06xx.c
index e72c3e1ab9ff..6080a35310ca 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx.c
@@ -51,8 +51,8 @@ int stv06xx_write_bridge(struct sd *sd, u16 address, u16 i2c_data)
0x04, 0x40, address, 0, buf, len,
STV06XX_URB_MSG_TIMEOUT);
- PDEBUG(D_CONF, "Written 0x%x to address 0x%x, status: %d",
- i2c_data, address, err);
+ gspca_dbg(gspca_dev, D_CONF, "Written 0x%x to address 0x%x, status: %d\n",
+ i2c_data, address, err);
return (err < 0) ? err : 0;
}
@@ -70,8 +70,8 @@ int stv06xx_read_bridge(struct sd *sd, u16 address, u8 *i2c_data)
*i2c_data = buf[0];
- PDEBUG(D_CONF, "Reading 0x%x from address 0x%x, status %d",
- *i2c_data, address, err);
+ gspca_dbg(gspca_dev, D_CONF, "Reading 0x%x from address 0x%x, status %d\n",
+ *i2c_data, address, err);
return (err < 0) ? err : 0;
}
@@ -113,15 +113,16 @@ int stv06xx_write_sensor_bytes(struct sd *sd, const u8 *data, u8 len)
struct usb_device *udev = sd->gspca_dev.dev;
__u8 *buf = sd->gspca_dev.usb_buf;
- PDEBUG(D_CONF, "I2C: Command buffer contains %d entries", len);
+ gspca_dbg(gspca_dev, D_CONF, "I2C: Command buffer contains %d entries\n",
+ len);
for (i = 0; i < len;) {
/* Build the command buffer */
memset(buf, 0, I2C_BUFFER_LENGTH);
for (j = 0; j < I2C_MAX_BYTES && i < len; j++, i++) {
buf[j] = data[2*i];
buf[0x10 + j] = data[2*i+1];
- PDEBUG(D_CONF, "I2C: Writing 0x%02x to reg 0x%02x",
- data[2*i+1], data[2*i]);
+ gspca_dbg(gspca_dev, D_CONF, "I2C: Writing 0x%02x to reg 0x%02x\n",
+ data[2*i+1], data[2*i]);
}
buf[0x20] = sd->sensor->i2c_addr;
buf[0x21] = j - 1; /* Number of commands to send - 1 */
@@ -143,7 +144,8 @@ int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len)
struct usb_device *udev = sd->gspca_dev.dev;
__u8 *buf = sd->gspca_dev.usb_buf;
- PDEBUG(D_CONF, "I2C: Command buffer contains %d entries", len);
+ gspca_dbg(gspca_dev, D_CONF, "I2C: Command buffer contains %d entries\n",
+ len);
for (i = 0; i < len;) {
/* Build the command buffer */
@@ -152,8 +154,8 @@ int stv06xx_write_sensor_words(struct sd *sd, const u16 *data, u8 len)
buf[j] = data[2*i];
buf[0x10 + j * 2] = data[2*i+1];
buf[0x10 + j * 2 + 1] = data[2*i+1] >> 8;
- PDEBUG(D_CONF, "I2C: Writing 0x%04x to reg 0x%02x",
- data[2*i+1], data[2*i]);
+ gspca_dbg(gspca_dev, D_CONF, "I2C: Writing 0x%04x to reg 0x%02x\n",
+ data[2*i+1], data[2*i]);
}
buf[0x20] = sd->sensor->i2c_addr;
buf[0x21] = j - 1; /* Number of commands to send - 1 */
@@ -205,8 +207,8 @@ int stv06xx_read_sensor(struct sd *sd, const u8 address, u16 *value)
else
*value = buf[0];
- PDEBUG(D_CONF, "I2C: Read 0x%x from address 0x%x, status: %d",
- *value, address, err);
+ gspca_dbg(gspca_dev, D_CONF, "I2C: Read 0x%x from address 0x%x, status: %d\n",
+ *value, address, err);
return (err < 0) ? err : 0;
}
@@ -249,7 +251,7 @@ static int stv06xx_init(struct gspca_dev *gspca_dev)
struct sd *sd = (struct sd *) gspca_dev;
int err;
- PDEBUG(D_PROBE, "Initializing camera");
+ gspca_dbg(gspca_dev, D_PROBE, "Initializing camera\n");
/* Let the usb init settle for a bit
before performing the initialization */
@@ -268,7 +270,7 @@ static int stv06xx_init_controls(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
- PDEBUG(D_PROBE, "Initializing controls");
+ gspca_dbg(gspca_dev, D_PROBE, "Initializing controls\n");
gspca_dev->vdev.ctrl_handler = &gspca_dev->ctrl_handler;
return sd->sensor->init_controls(sd);
@@ -285,7 +287,7 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)
intf = usb_ifnum_to_if(sd->gspca_dev.dev, sd->gspca_dev.iface);
alt = usb_altnum_to_altsetting(intf, sd->gspca_dev.alt);
if (!alt) {
- PERR("Couldn't get altsetting");
+ gspca_err(gspca_dev, "Couldn't get altsetting\n");
return -EIO;
}
@@ -304,9 +306,9 @@ static int stv06xx_start(struct gspca_dev *gspca_dev)
out:
if (err < 0)
- PDEBUG(D_STREAM, "Starting stream failed");
+ gspca_dbg(gspca_dev, D_STREAM, "Starting stream failed\n");
else
- PDEBUG(D_STREAM, "Started streaming");
+ gspca_dbg(gspca_dev, D_STREAM, "Started streaming\n");
return (err < 0) ? err : 0;
}
@@ -343,7 +345,7 @@ static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev)
ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1);
if (ret < 0)
- PERR("set alt 1 err %d", ret);
+ gspca_err(gspca_dev, "set alt 1 err %d\n", ret);
return ret;
}
@@ -362,9 +364,9 @@ static void stv06xx_stopN(struct gspca_dev *gspca_dev)
out:
if (err < 0)
- PDEBUG(D_STREAM, "Failed to stop stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Failed to stop stream\n");
else
- PDEBUG(D_STREAM, "Stopped streaming");
+ gspca_dbg(gspca_dev, D_STREAM, "Stopped streaming\n");
}
/*
@@ -385,7 +387,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
{
struct sd *sd = (struct sd *) gspca_dev;
- PDEBUG(D_PACK, "Packet of length %d arrived", len);
+ gspca_dbg(gspca_dev, D_PACK, "Packet of length %d arrived\n", len);
/* A packet may contain several frames
loop until the whole packet is reached */
@@ -393,7 +395,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
int id, chunk_len;
if (len < 4) {
- PDEBUG(D_PACK, "Packet is smaller than 4 bytes");
+ gspca_dbg(gspca_dev, D_PACK, "Packet is smaller than 4 bytes\n");
return;
}
@@ -402,13 +404,14 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
/* Capture the chunk length */
chunk_len = (data[2] << 8) | data[3];
- PDEBUG(D_PACK, "Chunk id: %x, length: %d", id, chunk_len);
+ gspca_dbg(gspca_dev, D_PACK, "Chunk id: %x, length: %d\n",
+ id, chunk_len);
data += 4;
len -= 4;
if (len < chunk_len) {
- PERR("URB packet length is smaller than the specified chunk length");
+ gspca_err(gspca_dev, "URB packet length is smaller than the specified chunk length\n");
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
@@ -421,7 +424,7 @@ static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
case 0x0200:
case 0x4200:
frame_data:
- PDEBUG(D_PACK, "Frame data packet detected");
+ gspca_dbg(gspca_dev, D_PACK, "Frame data packet detected\n");
if (sd->to_skip) {
int skip = (sd->to_skip < chunk_len) ?
@@ -440,7 +443,7 @@ frame_data:
case 0x8005:
case 0xc001:
case 0xc005:
- PDEBUG(D_PACK, "Starting new frame");
+ gspca_dbg(gspca_dev, D_PACK, "Starting new frame\n");
/* Create a new frame, chunk length should be zero */
gspca_frame_add(gspca_dev, FIRST_PACKET,
@@ -450,40 +453,41 @@ frame_data:
sd->to_skip = gspca_dev->pixfmt.width * 4;
if (chunk_len)
- PERR("Chunk length is non-zero on a SOF");
+ gspca_err(gspca_dev, "Chunk length is non-zero on a SOF\n");
break;
case 0x8002:
case 0x8006:
case 0xc002:
- PDEBUG(D_PACK, "End of frame detected");
+ gspca_dbg(gspca_dev, D_PACK, "End of frame detected\n");
/* Complete the last frame (if any) */
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
if (chunk_len)
- PERR("Chunk length is non-zero on a EOF");
+ gspca_err(gspca_dev, "Chunk length is non-zero on a EOF\n");
break;
case 0x0005:
- PDEBUG(D_PACK, "Chunk 0x005 detected");
+ gspca_dbg(gspca_dev, D_PACK, "Chunk 0x005 detected\n");
/* Unknown chunk with 11 bytes of data,
occurs just before end of each frame
in compressed mode */
break;
case 0x0100:
- PDEBUG(D_PACK, "Chunk 0x0100 detected");
+ gspca_dbg(gspca_dev, D_PACK, "Chunk 0x0100 detected\n");
/* Unknown chunk with 2 bytes of data,
occurs 2-3 times per USB interrupt */
break;
case 0x42ff:
- PDEBUG(D_PACK, "Chunk 0x42ff detected");
+ gspca_dbg(gspca_dev, D_PACK, "Chunk 0x42ff detected\n");
/* Special chunk seen sometimes on the ST6422 */
break;
default:
- PDEBUG(D_PACK, "Unknown chunk 0x%04x detected", id);
+ gspca_dbg(gspca_dev, D_PACK, "Unknown chunk 0x%04x detected\n",
+ id);
/* Unknown chunk */
}
data += chunk_len;
@@ -539,7 +543,7 @@ static int stv06xx_config(struct gspca_dev *gspca_dev,
{
struct sd *sd = (struct sd *) gspca_dev;
- PDEBUG(D_PROBE, "Configuring camera");
+ gspca_dbg(gspca_dev, D_PROBE, "Configuring camera\n");
sd->bridge = id->driver_info;
gspca_dev->sd_desc = &sd_desc;
@@ -575,7 +579,7 @@ static int stv06xx_config(struct gspca_dev *gspca_dev,
/* -- module initialisation -- */
static const struct usb_device_id device_table[] = {
- {USB_DEVICE(0x046d, 0x0840), .driver_info = BRIDGE_STV600 }, /* QuickCam Express */
+ {USB_DEVICE(0x046d, 0x0840), .driver_info = BRIDGE_STV600 }, /* QuickCam Express */
{USB_DEVICE(0x046d, 0x0850), .driver_info = BRIDGE_STV610 }, /* LEGO cam / QuickCam Web */
{USB_DEVICE(0x046d, 0x0870), .driver_info = BRIDGE_STV602 }, /* Dexxa WebCam USB */
{USB_DEVICE(0x046D, 0x08F0), .driver_info = BRIDGE_ST6422 }, /* QuickCam Messenger */
@@ -598,7 +602,7 @@ static void sd_disconnect(struct usb_interface *intf)
struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
struct sd *sd = (struct sd *) gspca_dev;
void *priv = sd->sensor_priv;
- PDEBUG(D_PROBE, "Disconnecting the stv06xx device");
+ gspca_dbg(gspca_dev, D_PROBE, "Disconnecting the stv06xx device\n");
sd->sensor = NULL;
gspca_disconnect(intf);
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx.h b/drivers/media/usb/gspca/stv06xx/stv06xx.h
index f9d74e4d7cf9..480186706bba 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx.h
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx.h
@@ -59,7 +59,7 @@
/* Refers to the CIF 352x288 and QCIF 176x144 */
/* 1: 288 lines, 2: 144 lines */
-#define STV_Y_CTRL 0x15c3
+#define STV_Y_CTRL 0x15c3
#define STV_RESET 0x1620
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
index 28252f6c4afd..d8db2c89718f 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_hdcs.c
@@ -251,8 +251,8 @@ static int hdcs_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
if (err < 0)
return err;
}
- PDEBUG(D_CONF, "Writing exposure %d, rowexp %d, srowexp %d",
- val, rowexp, srowexp);
+ gspca_dbg(gspca_dev, D_CONF, "Writing exposure %d, rowexp %d, srowexp %d\n",
+ val, rowexp, srowexp);
return err;
}
@@ -276,7 +276,7 @@ static int hdcs_set_gains(struct sd *sd, u8 g)
static int hdcs_set_gain(struct gspca_dev *gspca_dev, __s32 val)
{
- PDEBUG(D_CONF, "Writing gain %d", val);
+ gspca_dbg(gspca_dev, D_CONF, "Writing gain %d\n", val);
return hdcs_set_gains((struct sd *) gspca_dev,
val & 0xff);
}
@@ -465,7 +465,7 @@ static int hdcs_start(struct sd *sd)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
- PDEBUG(D_STREAM, "Starting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Starting stream\n");
return hdcs_set_state(sd, HDCS_STATE_RUN);
}
@@ -474,7 +474,7 @@ static int hdcs_stop(struct sd *sd)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
- PDEBUG(D_STREAM, "Halting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Halting stream\n");
return hdcs_set_state(sd, HDCS_STATE_SLEEP);
}
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
index e1ce96e9405f..7374aeb0a67a 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_pb0100.c
@@ -229,7 +229,7 @@ static int pb0100_start(struct sd *sd)
}
err = stv06xx_write_sensor(sd, PB_CONTROL, BIT(5)|BIT(3)|BIT(1));
- PDEBUG(D_STREAM, "Started stream, status: %d", err);
+ gspca_dbg(gspca_dev, D_STREAM, "Started stream, status: %d\n", err);
return (err < 0) ? err : 0;
}
@@ -247,7 +247,7 @@ static int pb0100_stop(struct sd *sd)
/* Set bit 1 to zero */
err = stv06xx_write_sensor(sd, PB_CONTROL, BIT(5)|BIT(3));
- PDEBUG(D_STREAM, "Halting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Halting stream\n");
out:
return (err < 0) ? err : 0;
}
@@ -332,7 +332,8 @@ static int pb0100_set_gain(struct gspca_dev *gspca_dev, __s32 val)
err = stv06xx_write_sensor(sd, PB_G1GAIN, val);
if (!err)
err = stv06xx_write_sensor(sd, PB_G2GAIN, val);
- PDEBUG(D_CONF, "Set green gain to %d, status: %d", val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set green gain to %d, status: %d\n",
+ val, err);
if (!err)
err = pb0100_set_red_balance(gspca_dev, ctrls->red->val);
@@ -355,7 +356,8 @@ static int pb0100_set_red_balance(struct gspca_dev *gspca_dev, __s32 val)
val = 255;
err = stv06xx_write_sensor(sd, PB_RGAIN, val);
- PDEBUG(D_CONF, "Set red gain to %d, status: %d", val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set red gain to %d, status: %d\n",
+ val, err);
return err;
}
@@ -373,7 +375,8 @@ static int pb0100_set_blue_balance(struct gspca_dev *gspca_dev, __s32 val)
val = 255;
err = stv06xx_write_sensor(sd, PB_BGAIN, val);
- PDEBUG(D_CONF, "Set blue gain to %d, status: %d", val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set blue gain to %d, status: %d\n",
+ val, err);
return err;
}
@@ -384,7 +387,8 @@ static int pb0100_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
int err;
err = stv06xx_write_sensor(sd, PB_RINTTIME, val);
- PDEBUG(D_CONF, "Set exposure to %d, status: %d", val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set exposure to %d, status: %d\n",
+ val, err);
return err;
}
@@ -404,8 +408,8 @@ static int pb0100_set_autogain(struct gspca_dev *gspca_dev, __s32 val)
val = 0;
err = stv06xx_write_sensor(sd, PB_EXPGAIN, val);
- PDEBUG(D_CONF, "Set autogain to %d (natural: %d), status: %d",
- val, ctrls->natural->val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set autogain to %d (natural: %d), status: %d\n",
+ val, ctrls->natural->val, err);
return err;
}
@@ -426,7 +430,8 @@ static int pb0100_set_autogain_target(struct gspca_dev *gspca_dev, __s32 val)
if (!err)
err = stv06xx_write_sensor(sd, PB_R22, darkpixels);
- PDEBUG(D_CONF, "Set autogain target to %d, status: %d", val, err);
+ gspca_dbg(gspca_dev, D_CONF, "Set autogain target to %d, status: %d\n",
+ val, err);
return err;
}
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c
index 4b76070515b5..51a135c2f9f7 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_st6422.c
@@ -277,7 +277,7 @@ static int st6422_stop(struct sd *sd)
{
struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
- PDEBUG(D_STREAM, "Halting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Halting stream\n");
return 0;
}
diff --git a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c
index d265e6b00994..b2f16c2754fb 100644
--- a/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c
+++ b/drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c
@@ -129,7 +129,7 @@ static int vv6410_start(struct sd *sd)
u32 priv = cam->cam_mode[sd->gspca_dev.curr_mode].priv;
if (priv & VV6410_SUBSAMPLE) {
- PDEBUG(D_CONF, "Enabling subsampling");
+ gspca_dbg(gspca_dev, D_CONF, "Enabling subsampling\n");
stv06xx_write_bridge(sd, STV_Y_CTRL, 0x02);
stv06xx_write_bridge(sd, STV_X_CTRL, 0x06);
@@ -150,7 +150,7 @@ static int vv6410_start(struct sd *sd)
if (err < 0)
return err;
- PDEBUG(D_STREAM, "Starting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Starting stream\n");
return 0;
}
@@ -169,7 +169,7 @@ static int vv6410_stop(struct sd *sd)
if (err < 0)
return err;
- PDEBUG(D_STREAM, "Halting stream");
+ gspca_dbg(gspca_dev, D_STREAM, "Halting stream\n");
return 0;
}
@@ -203,7 +203,7 @@ static int vv6410_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
else
i2c_data &= ~VV6410_HFLIP;
- PDEBUG(D_CONF, "Set horizontal flip to %d", val);
+ gspca_dbg(gspca_dev, D_CONF, "Set horizontal flip to %d\n", val);
err = stv06xx_write_sensor(sd, VV6410_DATAFORMAT, i2c_data);
return (err < 0) ? err : 0;
@@ -224,7 +224,7 @@ static int vv6410_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
else
i2c_data &= ~VV6410_VFLIP;
- PDEBUG(D_CONF, "Set vertical flip to %d", val);
+ gspca_dbg(gspca_dev, D_CONF, "Set vertical flip to %d\n", val);
err = stv06xx_write_sensor(sd, VV6410_DATAFORMAT, i2c_data);
return (err < 0) ? err : 0;
@@ -235,7 +235,7 @@ static int vv6410_set_analog_gain(struct gspca_dev *gspca_dev, __s32 val)
int err;
struct sd *sd = (struct sd *) gspca_dev;
- PDEBUG(D_CONF, "Set analog gain to %d", val);
+ gspca_dbg(gspca_dev, D_CONF, "Set analog gain to %d\n", val);
err = stv06xx_write_sensor(sd, VV6410_ANALOGGAIN, 0xf0 | (val & 0xf));
return (err < 0) ? err : 0;
@@ -252,8 +252,8 @@ static int vv6410_set_exposure(struct gspca_dev *gspca_dev, __s32 val)
fine = val % VV6410_CIF_LINELENGTH;
coarse = min(512, val / VV6410_CIF_LINELENGTH);
- PDEBUG(D_CONF, "Set coarse exposure to %d, fine exposure to %d",
- coarse, fine);
+ gspca_dbg(gspca_dev, D_CONF, "Set coarse exposure to %d, fine exposure to %d\n",
+ coarse, fine);
err = stv06xx_write_sensor(sd, VV6410_FINEH, fine >> 8);
if (err < 0)