public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RESEND] gspca-stk1135: Add delay after configuring clock
@ 2013-11-11 22:31 Ondrej Zary
  2013-11-11 22:46 ` Sylwester Nawrocki
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Zary @ 2013-11-11 22:31 UTC (permalink / raw)
  To: linux-media

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).

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
 drivers/media/usb/gspca/stk1135.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/usb/gspca/stk1135.c b/drivers/media/usb/gspca/stk1135.c
index 8add2f7..d8a813c 100644
--- a/drivers/media/usb/gspca/stk1135.c
+++ b/drivers/media/usb/gspca/stk1135.c
@@ -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)
-- 
Ondrej Zary

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [RESEND] gspca-stk1135: Add delay after configuring clock
  2013-11-11 22:31 [PATCH] [RESEND] gspca-stk1135: Add delay after configuring clock Ondrej Zary
@ 2013-11-11 22:46 ` Sylwester Nawrocki
  0 siblings, 0 replies; 2+ messages in thread
From: Sylwester Nawrocki @ 2013-11-11 22:46 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: linux-media

Hi Ondrej,

On 11/11/2013 11:31 PM, Ondrej Zary wrote:
> 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).
>
> Signed-off-by: Ondrej Zary<linux@rainbow-software.org>
> ---
>   drivers/media/usb/gspca/stk1135.c |    3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/usb/gspca/stk1135.c b/drivers/media/usb/gspca/stk1135.c
> index 8add2f7..d8a813c 100644
> --- a/drivers/media/usb/gspca/stk1135.c
> +++ b/drivers/media/usb/gspca/stk1135.c
> @@ -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);

>   }
>
>   static void stk1135_camera_disable(struct gspca_dev *gspca_dev)

--
Regards,
Sylwester

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-11 22:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 22:31 [PATCH] [RESEND] gspca-stk1135: Add delay after configuring clock Ondrej Zary
2013-11-11 22:46 ` Sylwester Nawrocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox