summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/pac7311.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-08-27 12:17:27 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-08-27 12:17:27 +0200
commit0188c2d4d85e0c45e110a3b39851aa72f5cc005e (patch)
treeb62fef95a26c05115b8ee41ab38978b7c0ac28a3 /linux/drivers/media/video/gspca/pac7311.c
parent3e2fbb7877cc79071ca37c36f9c3cc8c37c64682 (diff)
downloadmediapointer-dvb-s2-0188c2d4d85e0c45e110a3b39851aa72f5cc005e.tar.gz
mediapointer-dvb-s2-0188c2d4d85e0c45e110a3b39851aa72f5cc005e.tar.bz2
gspca: Move some probe code to the new init function.
From: Hans de Goede <j.w.r.degoede@hhs.nl> Priority: high Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/pac7311.c')
-rw-r--r--linux/drivers/media/video/gspca/pac7311.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/linux/drivers/media/video/gspca/pac7311.c b/linux/drivers/media/video/gspca/pac7311.c
index 05ad42f30..4003cc6cc 100644
--- a/linux/drivers/media/video/gspca/pac7311.c
+++ b/linux/drivers/media/video/gspca/pac7311.c
@@ -245,7 +245,7 @@ static struct v4l2_pix_format vga_mode[] = {
};
/* pac 7302 */
-static const __u8 probe_7302[] = {
+static const __u8 init_7302[] = {
/* index,value */
0xff, 0x01, /* page 1 */
0x78, 0x00, /* deactivate */
@@ -341,7 +341,7 @@ static const __u8 page3_7302[] = {
};
/* pac 7311 */
-static const __u8 probe_7311[] = {
+static const __u8 init_7311[] = {
0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */
0x78, 0x44, /* Bit_0=start stream, Bit_6=LED */
@@ -517,14 +517,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
sd->sensor = id->driver_info;
if (sd->sensor == SENSOR_PAC7302) {
PDEBUG(D_CONF, "Find Sensor PAC7302");
- reg_w_seq(gspca_dev, probe_7302, sizeof probe_7302);
-
cam->cam_mode = &vga_mode[2]; /* only 640x480 */
cam->nmodes = 1;
} else {
PDEBUG(D_CONF, "Find Sensor PAC7311");
- reg_w_seq(gspca_dev, probe_7311, sizeof probe_7311);
-
cam->cam_mode = vga_mode;
cam->nmodes = ARRAY_SIZE(vga_mode);
gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX)
@@ -683,6 +679,13 @@ static void sethvflip(struct gspca_dev *gspca_dev)
/* this function is called at probe and resume time */
static int sd_init(struct gspca_dev *gspca_dev)
{
+ struct sd *sd = (struct sd *) gspca_dev;
+
+ if (sd->sensor == SENSOR_PAC7302)
+ reg_w_seq(gspca_dev, init_7302, sizeof init_7302);
+ else
+ reg_w_seq(gspca_dev, init_7311, sizeof init_7311);
+
return 0;
}