Skip to contentSkip to conversation

gspca-stk1135: Add delay after configuring clock

PATCH RESEND In review Ondrej Zary 2 participants 2 messages Nov 11, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 gspca-stk1135: Add delay after configuring clock

Add a small delay at the end of configure_clock() to allow sensor to initialize.
This is needed by Asus VX2S laptop webcam to detect sensor type properly (the already-supported MT9M112).

---
 drivers/media/usb/gspca/stk1135.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/media/usb/gspca/stk1135.c +3 -0
index 8add2f7..d8a813c 100644
@@ -361,6 +361,9 @@ static void stk1135_configure_clock(struct gspca_dev *gspca_dev)
 
 	/* set serial interface clock divider (30MHz/0x1f*16+2) = 60240 kHz) */
 	reg_w(gspca_dev, STK1135_REG_SICTL + 2, 0x1f);
+
+	/* wait a while for sensor to catch up */
+	udelay(1000);
 }
 
 static void stk1135_camera_disable(struct gspca_dev *gspca_dev)
Signature · 1 line
Ondrej Zary
#1 lore raw

Hi Ondrej,

Quoted 13 lines · Ondrej Zary

Add a small delay at the end of configure_clock() to allow sensor to initialize.
This is needed by Asus VX2S laptop webcam to detect sensor type properly (the already-supported MT9M112).

---
  drivers/media/usb/gspca/stk1135.c |    3 +++
  1 file changed, 3 insertions(+)
drivers/media/usb/gspca/stk1135.c +0 -0
index 8add2f7..d8a813c 100644

drivers/media/usb/gspca/stk1135.c static void stk1135_configure_clock(struct gspca_dev *gspca_dev) · line 366

Quoted 6 lines
drivers/media/usb/gspca/stk1135.c +3 -0
@@ -361,6 +361,9 @@ static void stk1135_configure_clock(struct gspca_dev *gspca_dev)
 
  	/* set serial interface clock divider (30MHz/0x1f*16+2) = 60240 kHz) */
  	reg_w(gspca_dev, STK1135_REG_SICTL + 2, 0x1f);
+
+	/* wait a while for sensor to catch up */
+	udelay(1000);

Instead of this 1 ms busy loop waiting it might be more optimal to use usleep_range(), e.g. usleep_range(1000, 1100);

drivers/media/usb/gspca/stk1135.c static void stk1135_configure_clock(struct gspca_dev *gspca_dev) · line 369

Quoted 3 lines
drivers/media/usb/gspca/stk1135.c +0 -0
  }
 
  static void stk1135_camera_disable(struct gspca_dev *gspca_dev)

--
Regards,
Sylwester