Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124373
b: refs/heads/master
c: 9e1e7b0
h: refs/heads/master
i:
  124371: 3ef739e
v: v3
  • Loading branch information
Antonio Ospite authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 3d9cb43 commit 17a18cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3adba442246a81aad29cf99ef55500379b7a3669
refs/heads/master: 9e1e7b068debea80c3ffbde264d0389b8137b589
28 changes: 14 additions & 14 deletions trunk/drivers/media/video/gspca/ov534.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ static struct v4l2_pix_format vga_mode[] = {
.priv = 0},
};

static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val)
static void ov534_reg_write(struct usb_device *udev, u16 reg, u8 val)
{
u16 data = val;
u8 data = val;
int ret;

PDEBUG(D_USBO, "reg=0x%04x, val=0%04x", reg, val);
PDEBUG(D_USBO, "reg=0x%04x, val=0%02x", reg, val);
ret = usb_control_msg(udev,
usb_sndctrlpipe(udev, 0),
0x1,
Expand All @@ -77,31 +77,31 @@ static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val)
PDEBUG(D_ERR, "write failed");
}

static u16 ov534_reg_read(struct usb_device *udev, u16 reg)
static u8 ov534_reg_read(struct usb_device *udev, u16 reg)
{
u16 data;
u8 data;
int ret;

ret = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
0x1,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
0x0, reg, &data, 1, CTRL_TIMEOUT);
PDEBUG(D_USBI, "reg=0x%04x, data=0x%04x", reg, data);
PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, data);
if (ret < 0)
PDEBUG(D_ERR, "read failed");
return data;
}

static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val)
static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u8 val)
{
u16 data;
u8 data;

ov534_reg_write(udev, reg, val);
data = ov534_reg_read(udev, reg);
if (data != val) {
PDEBUG(D_ERR | D_USBO,
"unexpected result from read: 0x%04x != 0x%04x", val,
"unexpected result from read: 0x%02x != 0x%02x", val,
data);
}
}
Expand All @@ -110,7 +110,7 @@ static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val)
* (direction and output)? */
static void ov534_set_led(struct usb_device *udev, int status)
{
u16 data;
u8 data;

PDEBUG(D_CONF, "led status: %d", status);

Expand All @@ -129,13 +129,13 @@ static void ov534_set_led(struct usb_device *udev, int status)

static int sccb_check_status(struct usb_device *udev)
{
u16 data;
u8 data;
int i;

for (i = 0; i < 5; i++) {
data = ov534_reg_read(udev, OV534_REG_STATUS);

switch (data & 0xFF) {
switch (data) {
case 0x00:
return 1;
case 0x04:
Expand All @@ -150,9 +150,9 @@ static int sccb_check_status(struct usb_device *udev)
return 0;
}

static void sccb_reg_write(struct usb_device *udev, u16 reg, u16 val)
static void sccb_reg_write(struct usb_device *udev, u16 reg, u8 val)
{
PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%04x", reg, val);
PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%02x", reg, val);
ov534_reg_write(udev, OV534_REG_SUBADDR, reg);
ov534_reg_write(udev, OV534_REG_WRITE, val);
ov534_reg_write(udev, OV534_REG_OPERATION, OV534_OP_WRITE_3);
Expand Down

0 comments on commit 17a18cc

Please sign in to comment.