diff options
author | Erik Andren <erik.andren@gmail.com> | 2008-10-03 14:29:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:37:13 -0400 |
commit | d2d7e9ae3138307284c815e1c37ea0b7b8834692 (patch) | |
tree | 2e4cfaa2010c34130c86f0a2d16e10950810b279 /drivers/media | |
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')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_bridge.h | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_core.c | 28 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_mt9m111.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_po1030.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 3 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k83a.c | 2 |
7 files changed, 20 insertions, 21 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_bridge.h b/drivers/media/video/gspca/m5602/m5602_bridge.h index fcbc37bfea5..18ca19a9436 100644 --- a/drivers/media/video/gspca/m5602/m5602_bridge.h +++ b/drivers/media/video/gspca/m5602/m5602_bridge.h | |||
@@ -152,6 +152,8 @@ struct sd { | |||
152 | /* A pointer to the currently connected sensor */ | 152 | /* A pointer to the currently connected sensor */ |
153 | struct m5602_sensor *sensor; | 153 | struct m5602_sensor *sensor; |
154 | 154 | ||
155 | struct sd_desc *desc; | ||
156 | |||
155 | /* The current frame's id, used to detect frame boundaries */ | 157 | /* The current frame's id, used to detect frame boundaries */ |
156 | u8 frame_id; | 158 | u8 frame_id; |
157 | 159 | ||
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) | |||
108 | { | 108 | { |
109 | /* Try the po1030 */ | 109 | /* Try the po1030 */ |
110 | sd->sensor = &po1030; | 110 | sd->sensor = &po1030; |
111 | if (!sd->sensor->probe(sd)) { | 111 | if (!sd->sensor->probe(sd)) |
112 | sd_desc.ctrls = po1030.ctrls; | ||
113 | sd_desc.nctrls = po1030.nctrls; | ||
114 | return 0; | 112 | return 0; |
115 | } | ||
116 | 113 | ||
117 | /* Try the mt9m111 sensor */ | 114 | /* Try the mt9m111 sensor */ |
118 | sd->sensor = &mt9m111; | 115 | sd->sensor = &mt9m111; |
119 | if (!sd->sensor->probe(sd)) { | 116 | if (!sd->sensor->probe(sd)) |
120 | sd_desc.ctrls = mt9m111.ctrls; | ||
121 | sd_desc.nctrls = mt9m111.nctrls; | ||
122 | return 0; | 117 | return 0; |
123 | } | ||
124 | 118 | ||
125 | /* Try the s5k4aa */ | 119 | /* Try the s5k4aa */ |
126 | sd->sensor = &s5k4aa; | 120 | sd->sensor = &s5k4aa; |
127 | if (!sd->sensor->probe(sd)) { | 121 | if (!sd->sensor->probe(sd)) |
128 | sd_desc.ctrls = s5k4aa.ctrls; | ||
129 | sd_desc.nctrls = s5k4aa.nctrls; | ||
130 | return 0; | 122 | return 0; |
131 | } | ||
132 | 123 | ||
133 | /* Try the ov9650 */ | 124 | /* Try the ov9650 */ |
134 | sd->sensor = &ov9650; | 125 | sd->sensor = &ov9650; |
135 | if (!sd->sensor->probe(sd)) { | 126 | if (!sd->sensor->probe(sd)) |
136 | sd_desc.ctrls = ov9650.ctrls; | ||
137 | sd_desc.nctrls = ov9650.nctrls; | ||
138 | return 0; | 127 | return 0; |
139 | } | ||
140 | 128 | ||
141 | /* Try the s5k83a */ | 129 | /* Try the s5k83a */ |
142 | sd->sensor = &s5k83a; | 130 | sd->sensor = &s5k83a; |
143 | if (!sd->sensor->probe(sd)) { | 131 | if (!sd->sensor->probe(sd)) |
144 | sd_desc.ctrls = s5k83a.ctrls; | ||
145 | sd_desc.nctrls = s5k83a.nctrls; | ||
146 | return 0; | 132 | return 0; |
147 | } | ||
148 | |||
149 | 133 | ||
150 | /* More sensor probe function goes here */ | 134 | /* More sensor probe function goes here */ |
151 | info("Failed to find a sensor"); | 135 | info("Failed to find a sensor"); |
@@ -246,8 +230,10 @@ int m5602_configure(struct gspca_dev *gspca_dev, | |||
246 | int err; | 230 | int err; |
247 | 231 | ||
248 | PDEBUG(DBG_GSPCA, "m5602_configure start"); | 232 | PDEBUG(DBG_GSPCA, "m5602_configure start"); |
233 | |||
249 | cam = &gspca_dev->cam; | 234 | cam = &gspca_dev->cam; |
250 | cam->epaddr = M5602_ISOC_ENDPOINT_ADDR; | 235 | cam->epaddr = M5602_ISOC_ENDPOINT_ADDR; |
236 | sd->desc = &sd_desc; | ||
251 | 237 | ||
252 | if (dump_bridge) | 238 | if (dump_bridge) |
253 | m5602_dump_bridge(sd); | 239 | m5602_dump_bridge(sd); |
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 17f04dd5e1d..ea2250217b0 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -62,6 +62,8 @@ int mt9m111_probe(struct sd *sd) | |||
62 | sensor_found: | 62 | sensor_found: |
63 | sd->gspca_dev.cam.cam_mode = mt9m111.modes; | 63 | sd->gspca_dev.cam.cam_mode = mt9m111.modes; |
64 | sd->gspca_dev.cam.nmodes = mt9m111.nmodes; | 64 | sd->gspca_dev.cam.nmodes = mt9m111.nmodes; |
65 | sd->desc->ctrls = mt9m111.ctrls; | ||
66 | sd->desc->nctrls = mt9m111.nctrls; | ||
65 | return 0; | 67 | return 0; |
66 | } | 68 | } |
67 | 69 | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c index 74c3ffec0ca..31c5896250e 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.c +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c | |||
@@ -132,6 +132,8 @@ int ov9650_probe(struct sd *sd) | |||
132 | sensor_found: | 132 | sensor_found: |
133 | sd->gspca_dev.cam.cam_mode = ov9650.modes; | 133 | sd->gspca_dev.cam.cam_mode = ov9650.modes; |
134 | sd->gspca_dev.cam.nmodes = ov9650.nmodes; | 134 | sd->gspca_dev.cam.nmodes = ov9650.nmodes; |
135 | sd->desc->ctrls = ov9650.ctrls; | ||
136 | sd->desc->nctrls = ov9650.nctrls; | ||
135 | return 0; | 137 | return 0; |
136 | } | 138 | } |
137 | 139 | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c index 14a8f929dd1..08c015bde11 100644 --- a/drivers/media/video/gspca/m5602/m5602_po1030.c +++ b/drivers/media/video/gspca/m5602/m5602_po1030.c | |||
@@ -59,6 +59,8 @@ int po1030_probe(struct sd *sd) | |||
59 | sensor_found: | 59 | sensor_found: |
60 | sd->gspca_dev.cam.cam_mode = po1030.modes; | 60 | sd->gspca_dev.cam.cam_mode = po1030.modes; |
61 | sd->gspca_dev.cam.nmodes = po1030.nmodes; | 61 | sd->gspca_dev.cam.nmodes = po1030.nmodes; |
62 | sd->desc->ctrls = po1030.ctrls; | ||
63 | sd->desc->nctrls = po1030.nctrls; | ||
62 | return 0; | 64 | return 0; |
63 | } | 65 | } |
64 | 66 | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index 3a2ae7a2e26..68202565325 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | |||
@@ -78,6 +78,9 @@ int s5k4aa_probe(struct sd *sd) | |||
78 | sensor_found: | 78 | sensor_found: |
79 | sd->gspca_dev.cam.cam_mode = s5k4aa.modes; | 79 | sd->gspca_dev.cam.cam_mode = s5k4aa.modes; |
80 | sd->gspca_dev.cam.nmodes = s5k4aa.nmodes; | 80 | sd->gspca_dev.cam.nmodes = s5k4aa.nmodes; |
81 | sd->desc->ctrls = s5k4aa.ctrls; | ||
82 | sd->desc->nctrls = s5k4aa.nctrls; | ||
83 | |||
81 | return 0; | 84 | return 0; |
82 | } | 85 | } |
83 | 86 | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c index a4d6a816312..c1ff967b1c3 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c +++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.c | |||
@@ -63,6 +63,8 @@ int s5k83a_probe(struct sd *sd) | |||
63 | sensor_found: | 63 | sensor_found: |
64 | sd->gspca_dev.cam.cam_mode = s5k83a.modes; | 64 | sd->gspca_dev.cam.cam_mode = s5k83a.modes; |
65 | sd->gspca_dev.cam.nmodes = s5k83a.nmodes; | 65 | sd->gspca_dev.cam.nmodes = s5k83a.nmodes; |
66 | sd->desc->ctrls = s5k83a.ctrls; | ||
67 | sd->desc->nctrls = s5k83a.nctrls; | ||
66 | return 0; | 68 | return 0; |
67 | } | 69 | } |
68 | 70 | ||