summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2009-01-21 07:33:14 +0100
committerErik Andrén <erik.andren@gmail.com>2009-01-21 07:33:14 +0100
commit2a5c5c2419b9efc9525275c4bfb3f426c3e362e9 (patch)
treeb755595c94a8afaf844ec3661204461407e73d2a
parent555fdb0a1db828c74aa0c03df6f3469cfba977e5 (diff)
downloadmediapointer-dvb-s2-2a5c5c2419b9efc9525275c4bfb3f426c3e362e9.tar.gz
mediapointer-dvb-s2-2a5c5c2419b9efc9525275c4bfb3f426c3e362e9.tar.bz2
gspca - m5602-s5k83a: Move hsync/vsync setup to start function
From: Erik Andrén <erik.andren@gmail.com> Priority: normal Signed-off-by: Erik Andrén <erik.andren@gmail.com>
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c16
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_s5k83a.h3
2 files changed, 18 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index 646796d21..118ec8f8c 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.c
@@ -299,15 +299,29 @@ static int rotation_thread_function(void *data)
int s5k83a_start(struct sd *sd)
{
+ int i, err = 0;
struct s5k83a_priv *sens_priv = sd->sensor_priv;
/* Create another thread, polling the GPIO ports of the camera to check
if it got rotated. This is how the windows driver does it so we have
to assume that there is no better way of accomplishing this */
sens_priv->rotation_thread = kthread_create(rotation_thread_function,
- sd, "rotation thread");
+ sd, "rotation thread");
wake_up_process(sens_priv->rotation_thread);
+ /* Preinit the sensor */
+ for (i = 0; i < ARRAY_SIZE(start_s5k83a) && !err; i++) {
+ u8 data[2] = {start_s5k83a[i][2], start_s5k83a[i][3]};
+ if (start_s5k83a[i][0] == SENSOR)
+ err = m5602_write_sensor(sd, start_s5k83a[i][1],
+ data, 2);
+ else
+ err = m5602_write_bridge(sd, start_s5k83a[i][1],
+ data[0]);
+ }
+ if (err < 0)
+ return err;
+
return s5k83a_set_led_indication(sd, 1);
}
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.h b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.h
index 47c0bb473..7814b078a 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.h
+++ b/linux/drivers/media/video/gspca/m5602/m5602_s5k83a.h
@@ -164,7 +164,10 @@ static const unsigned char init_s5k83a[][4] =
/* normal colors
(this is value after boot, but after tries can be different) */
{SENSOR, 0x00, 0x06, 0x00},
+};
+static const unsigned char start_s5k83a[][4] =
+{
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},