summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/stv06xx
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2009-06-24 09:30:56 +0200
committerErik Andrén <erik.andren@gmail.com>2009-06-24 09:30:56 +0200
commit78b0beaf9e13ab3591c37baea35488feeccfa152 (patch)
tree9c176ad20f964918ae52e4653968de73aaae2213 /linux/drivers/media/video/gspca/stv06xx
parent1da6ad98e478b29ad30ad485246a768225407d8b (diff)
downloadmediapointer-dvb-s2-78b0beaf9e13ab3591c37baea35488feeccfa152.tar.gz
mediapointer-dvb-s2-78b0beaf9e13ab3591c37baea35488feeccfa152.tar.bz2
gspca - stv06xx-hdcs: Fix sensor sequence bug
From: Erik Andrén <erik.andren@gmail.com> All hdcs registers use bit 0 as a read/write flag and needs to be shifted one bit to the left. This wasn't accounted for when doing a sequence of writes. Priority: high Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/stv06xx')
-rw-r--r--linux/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/linux/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c b/linux/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
index ec7f5536a..a45171be3 100644
--- a/linux/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
+++ b/linux/drivers/media/video/gspca/stv06xx/stv06xx_hdcs.c
@@ -131,9 +131,11 @@ static int hdcs_reg_write_seq(struct sd *sd, u8 reg, u8 *vals, u8 len)
(reg + len > 0xff)))
return -EINVAL;
- for (i = 0; i < len; i++, reg++) {
- regs[2*i] = reg;
- regs[2*i+1] = vals[i];
+ for (i = 0; i < len; i++) {
+ regs[2 * i] = reg;
+ regs[2 * i + 1] = vals[i];
+ /* All addresses are shifted left one bit as bit 0 toggles r/w */
+ reg += 2;
}
return stv06xx_write_sensor_bytes(sd, regs, len);