diff options
author | Erik Andren <erik.andren@gmail.com> | 2008-10-03 15:29:02 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 09:37:13 -0200 |
commit | d2d7e9ae3138307284c815e1c37ea0b7b8834692 (patch) | |
tree | 2e4cfaa2010c34130c86f0a2d16e10950810b279 /drivers/media/video/gspca/m5602/m5602_core.c | |
parent | 1b3345996c056a979cfabf96c0815b4843d9bbfc (diff) |
V4L/DVB (9095): gspca: Moves some sensor initialization to each sensor in m5602.
Signed-off-by: Erik Andren <erik.andren@gmail.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602/m5602_core.c')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_core.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c index 58ebffdcaae..47507350111 100644 --- a/drivers/media/video/gspca/m5602/m5602_core.c +++ b/drivers/media/video/gspca/m5602/m5602_core.c @@ -108,44 +108,28 @@ int m5602_probe_sensor(struct sd *sd) { /* Try the po1030 */ sd->sensor = &po1030; - if (!sd->sensor->probe(sd)) { - sd_desc.ctrls = po1030.ctrls; - sd_desc.nctrls = po1030.nctrls; + if (!sd->sensor->probe(sd)) return 0; - } /* Try the mt9m111 sensor */ sd->sensor = &mt9m111; - if (!sd->sensor->probe(sd)) { - sd_desc.ctrls = mt9m111.ctrls; - sd_desc.nctrls = mt9m111.nctrls; + if (!sd->sensor->probe(sd)) return 0; - } /* Try the s5k4aa */ sd->sensor = &s5k4aa; - if (!sd->sensor->probe(sd)) { - sd_desc.ctrls = s5k4aa.ctrls; - sd_desc.nctrls = s5k4aa.nctrls; + if (!sd->sensor->probe(sd)) return 0; - } /* Try the ov9650 */ sd->sensor = &ov9650; - if (!sd->sensor->probe(sd)) { - sd_desc.ctrls = ov9650.ctrls; - sd_desc.nctrls = ov9650.nctrls; + if (!sd->sensor->probe(sd)) return 0; - } /* Try the s5k83a */ sd->sensor = &s5k83a; - if (!sd->sensor->probe(sd)) { - sd_desc.ctrls = s5k83a.ctrls; - sd_desc.nctrls = s5k83a.nctrls; + if (!sd->sensor->probe(sd)) return 0; - } - /* More sensor probe function goes here */ info("Failed to find a sensor"); @@ -246,8 +230,10 @@ int m5602_configure(struct gspca_dev *gspca_dev, int err; PDEBUG(DBG_GSPCA, "m5602_configure start"); + cam = &gspca_dev->cam; cam->epaddr = M5602_ISOC_ENDPOINT_ADDR; + sd->desc = &sd_desc; if (dump_bridge) m5602_dump_bridge(sd); |