Skip to content

Commit

Permalink
[media] gspca - sn9c20x: Simplify register write for capture start/stop
Browse files Browse the repository at this point in the history
The bridge register 1061 may take only the values 01 (stop) or 03 (start).

Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean-François Moine authored and Mauro Carvalho Chehab committed Mar 20, 2012
1 parent 92dcffc commit ccbaba4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/video/gspca/sn9c20x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2107,9 +2107,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
set_hvflip(gspca_dev);

reg_w1(gspca_dev, 0x1007, 0x20);

reg_r(gspca_dev, 0x1061, 1);
reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] | 0x02);
reg_w1(gspca_dev, 0x1061, 0x03);

/* if JPEG, prepare the compression quality update */
if (mode & MODE_JPEG) {
Expand All @@ -2125,9 +2123,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
static void sd_stopN(struct gspca_dev *gspca_dev)
{
reg_w1(gspca_dev, 0x1007, 0x00);

reg_r(gspca_dev, 0x1061, 1);
reg_w1(gspca_dev, 0x1061, gspca_dev->usb_buf[0] & ~0x02);
reg_w1(gspca_dev, 0x1061, 0x01);
}

/* called on streamoff with alt==0 and on disconnect */
Expand Down

0 comments on commit ccbaba4

Please sign in to comment.