diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-03-25 11:04:11 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2009-03-25 11:04:11 +0100 |
commit | 996d759054f3a54df2a397c7e993f4e06e61d3dd (patch) | |
tree | 453ec3f4459664367c73e47444f2922dc672df58 /linux/drivers | |
parent | 9bf2b9b868cce9002b2e993e6014e40f0638e920 (diff) | |
download | mediapointer-dvb-s2-996d759054f3a54df2a397c7e993f4e06e61d3dd.tar.gz mediapointer-dvb-s2-996d759054f3a54df2a397c7e993f4e06e61d3dd.tar.bz2 |
gspca - vc032x: Simplify the i2c write function.
From: Jean-Francois Moine <moinejf@free.fr>
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/gspca/vc032x.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c index 81d2054b5..fbe89c7d1 100644 --- a/linux/drivers/media/video/gspca/vc032x.c +++ b/linux/drivers/media/video/gspca/vc032x.c @@ -2438,33 +2438,19 @@ static int vc032x_probe_sensor(struct gspca_dev *gspca_dev) } static void i2c_write(struct gspca_dev *gspca_dev, - __u8 reg, const __u8 *val, __u8 size) + u8 reg, const u8 *val, + u8 size) /* 1 or 2 */ { struct usb_device *dev = gspca_dev->dev; int retry; -#ifdef GSPCA_DEBUG - if (size > 3 || size < 1) - return; -#endif reg_r(gspca_dev, 0xa1, 0xb33f, 1); +/*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/ reg_w(dev, 0xa0, size, 0xb334); reg_w(dev, 0xa0, reg, 0xb33a); - switch (size) { - case 1: - reg_w(dev, 0xa0, val[0], 0xb336); - break; - case 2: - reg_w(dev, 0xa0, val[0], 0xb336); - reg_w(dev, 0xa0, val[1], 0xb337); - break; - default: -/* case 3: */ - reg_w(dev, 0xa0, val[0], 0xb336); + reg_w(dev, 0xa0, val[0], 0xb336); + if (size > 1) reg_w(dev, 0xa0, val[1], 0xb337); - reg_w(dev, 0xa0, val[2], 0xb338); - break; - } reg_w(dev, 0xa0, 0x01, 0xb339); retry = 4; do { |