Skip to content

Commit

Permalink
V4L/DVB (13994): gscpa_stv0680: Fix camera initialization on hotplug
Browse files Browse the repository at this point in the history
stv0680 cameras currently only work when already plugged in when the system
boots (or when manually re-loading the driver after boot). This patch fixes
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 9336960 commit ab269d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/video/gspca/stv0680.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
struct sd *sd = (struct sd *) gspca_dev;
struct cam *cam = &gspca_dev->cam;

/* Give the camera some time to settle, otherwise initalization will
fail on hotplug, and yes it really needs a full second. */
msleep(1000);

/* ping camera to be sure STV0680 is present */
if (stv_sndctrl(gspca_dev, 0, 0x88, 0x5678, 0x02) != 0x02 ||
gspca_dev->usb_buf[0] != 0x56 || gspca_dev->usb_buf[1] != 0x78) {
Expand Down

0 comments on commit ab269d3

Please sign in to comment.