diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2008-12-03 12:10:01 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:38:53 -0500 |
commit | 9e1e7b068debea80c3ffbde264d0389b8137b589 (patch) | |
tree | c2569e127a3aaf664dbeb5b045a6eec4f1b7003c /drivers/media/video/gspca/ov534.c | |
parent | 3adba442246a81aad29cf99ef55500379b7a3669 (diff) |
V4L/DVB (9856): gspca: Use u8 values for USB control messages in ov534.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/ov534.c')
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index b26faae8d759..530f0b712166 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -62,12 +62,12 @@ static struct v4l2_pix_format vga_mode[] = { | |||
62 | .priv = 0}, | 62 | .priv = 0}, |
63 | }; | 63 | }; |
64 | 64 | ||
65 | static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val) | 65 | static void ov534_reg_write(struct usb_device *udev, u16 reg, u8 val) |
66 | { | 66 | { |
67 | u16 data = val; | 67 | u8 data = val; |
68 | int ret; | 68 | int ret; |
69 | 69 | ||
70 | PDEBUG(D_USBO, "reg=0x%04x, val=0%04x", reg, val); | 70 | PDEBUG(D_USBO, "reg=0x%04x, val=0%02x", reg, val); |
71 | ret = usb_control_msg(udev, | 71 | ret = usb_control_msg(udev, |
72 | usb_sndctrlpipe(udev, 0), | 72 | usb_sndctrlpipe(udev, 0), |
73 | 0x1, | 73 | 0x1, |
@@ -77,9 +77,9 @@ static void ov534_reg_write(struct usb_device *udev, u16 reg, u16 val) | |||
77 | PDEBUG(D_ERR, "write failed"); | 77 | PDEBUG(D_ERR, "write failed"); |
78 | } | 78 | } |
79 | 79 | ||
80 | static u16 ov534_reg_read(struct usb_device *udev, u16 reg) | 80 | static u8 ov534_reg_read(struct usb_device *udev, u16 reg) |
81 | { | 81 | { |
82 | u16 data; | 82 | u8 data; |
83 | int ret; | 83 | int ret; |
84 | 84 | ||
85 | ret = usb_control_msg(udev, | 85 | ret = usb_control_msg(udev, |
@@ -87,21 +87,21 @@ static u16 ov534_reg_read(struct usb_device *udev, u16 reg) | |||
87 | 0x1, | 87 | 0x1, |
88 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 88 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
89 | 0x0, reg, &data, 1, CTRL_TIMEOUT); | 89 | 0x0, reg, &data, 1, CTRL_TIMEOUT); |
90 | PDEBUG(D_USBI, "reg=0x%04x, data=0x%04x", reg, data); | 90 | PDEBUG(D_USBI, "reg=0x%04x, data=0x%02x", reg, data); |
91 | if (ret < 0) | 91 | if (ret < 0) |
92 | PDEBUG(D_ERR, "read failed"); | 92 | PDEBUG(D_ERR, "read failed"); |
93 | return data; | 93 | return data; |
94 | } | 94 | } |
95 | 95 | ||
96 | static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val) | 96 | static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u8 val) |
97 | { | 97 | { |
98 | u16 data; | 98 | u8 data; |
99 | 99 | ||
100 | ov534_reg_write(udev, reg, val); | 100 | ov534_reg_write(udev, reg, val); |
101 | data = ov534_reg_read(udev, reg); | 101 | data = ov534_reg_read(udev, reg); |
102 | if (data != val) { | 102 | if (data != val) { |
103 | PDEBUG(D_ERR | D_USBO, | 103 | PDEBUG(D_ERR | D_USBO, |
104 | "unexpected result from read: 0x%04x != 0x%04x", val, | 104 | "unexpected result from read: 0x%02x != 0x%02x", val, |
105 | data); | 105 | data); |
106 | } | 106 | } |
107 | } | 107 | } |
@@ -110,7 +110,7 @@ static void ov534_reg_verify_write(struct usb_device *udev, u16 reg, u16 val) | |||
110 | * (direction and output)? */ | 110 | * (direction and output)? */ |
111 | static void ov534_set_led(struct usb_device *udev, int status) | 111 | static void ov534_set_led(struct usb_device *udev, int status) |
112 | { | 112 | { |
113 | u16 data; | 113 | u8 data; |
114 | 114 | ||
115 | PDEBUG(D_CONF, "led status: %d", status); | 115 | PDEBUG(D_CONF, "led status: %d", status); |
116 | 116 | ||
@@ -129,13 +129,13 @@ static void ov534_set_led(struct usb_device *udev, int status) | |||
129 | 129 | ||
130 | static int sccb_check_status(struct usb_device *udev) | 130 | static int sccb_check_status(struct usb_device *udev) |
131 | { | 131 | { |
132 | u16 data; | 132 | u8 data; |
133 | int i; | 133 | int i; |
134 | 134 | ||
135 | for (i = 0; i < 5; i++) { | 135 | for (i = 0; i < 5; i++) { |
136 | data = ov534_reg_read(udev, OV534_REG_STATUS); | 136 | data = ov534_reg_read(udev, OV534_REG_STATUS); |
137 | 137 | ||
138 | switch (data & 0xFF) { | 138 | switch (data) { |
139 | case 0x00: | 139 | case 0x00: |
140 | return 1; | 140 | return 1; |
141 | case 0x04: | 141 | case 0x04: |
@@ -150,9 +150,9 @@ static int sccb_check_status(struct usb_device *udev) | |||
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
152 | 152 | ||
153 | static void sccb_reg_write(struct usb_device *udev, u16 reg, u16 val) | 153 | static void sccb_reg_write(struct usb_device *udev, u16 reg, u8 val) |
154 | { | 154 | { |
155 | PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%04x", reg, val); | 155 | PDEBUG(D_USBO, "reg: 0x%04x, val: 0x%02x", reg, val); |
156 | ov534_reg_write(udev, OV534_REG_SUBADDR, reg); | 156 | ov534_reg_write(udev, OV534_REG_SUBADDR, reg); |
157 | ov534_reg_write(udev, OV534_REG_WRITE, val); | 157 | ov534_reg_write(udev, OV534_REG_WRITE, val); |
158 | ov534_reg_write(udev, OV534_REG_OPERATION, OV534_OP_WRITE_3); | 158 | ov534_reg_write(udev, OV534_REG_OPERATION, OV534_OP_WRITE_3); |