aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-10-05 03:46:11 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:15 -0400
commite66c6419231cd61a1be04ef84bc6264556289e7d (patch)
tree587d485fff5af0daa978412c173955e2ceb6a442 /drivers/media/video
parent3145b8c1bfb96b02abf63dcd83ec7517c22cb574 (diff)
V4L/DVB (9120): gspca: sd_desc->start returns a value and static functions in m5602.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_bridge.h12
-rw-r--r--drivers/media/video/gspca/m5602/m5602_core.c37
2 files changed, 21 insertions, 28 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_bridge.h b/drivers/media/video/gspca/m5602/m5602_bridge.h
index 18ca19a94364..c786d7d3d44a 100644
--- a/drivers/media/video/gspca/m5602/m5602_bridge.h
+++ b/drivers/media/video/gspca/m5602/m5602_bridge.h
@@ -167,16 +167,4 @@ int m5602_read_bridge(
167int m5602_write_bridge( 167int m5602_write_bridge(
168 struct sd *sd, u8 address, u8 i2c_data); 168 struct sd *sd, u8 address, u8 i2c_data);
169 169
170int m5602_configure(struct gspca_dev *gspca_dev,
171 const struct usb_device_id *id);
172
173int m5602_init(struct gspca_dev *gspca_dev);
174
175void m5602_start_transfer(struct gspca_dev *gspca_dev);
176
177void m5602_stop_transfer(struct gspca_dev *gspca_dev);
178
179void m5602_urb_complete(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
180 __u8 *data, int len);
181
182#endif 170#endif
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c
index 475073501117..19d5e351ccc1 100644
--- a/drivers/media/video/gspca/m5602/m5602_core.c
+++ b/drivers/media/video/gspca/m5602/m5602_core.c
@@ -35,16 +35,6 @@ static const __devinitdata struct usb_device_id m5602_table[] = {
35 35
36MODULE_DEVICE_TABLE(usb, m5602_table); 36MODULE_DEVICE_TABLE(usb, m5602_table);
37 37
38/* sub-driver description, the ctrl and nctrl is filled at probe time */
39static struct sd_desc sd_desc = {
40 .name = MODULE_NAME,
41 .config = m5602_configure,
42 .init = m5602_init,
43 .start = m5602_start_transfer,
44 .stopN = m5602_stop_transfer,
45 .pkt_scan = m5602_urb_complete
46};
47
48/* Reads a byte from the m5602 */ 38/* Reads a byte from the m5602 */
49int m5602_read_bridge(struct sd *sd, u8 address, u8 *i2c_data) 39int m5602_read_bridge(struct sd *sd, u8 address, u8 *i2c_data)
50{ 40{
@@ -104,7 +94,7 @@ static void m5602_dump_bridge(struct sd *sd)
104 info("Warning: The camera probably won't work until it's power cycled"); 94 info("Warning: The camera probably won't work until it's power cycled");
105} 95}
106 96
107int m5602_probe_sensor(struct sd *sd) 97static int m5602_probe_sensor(struct sd *sd)
108{ 98{
109 /* Try the po1030 */ 99 /* Try the po1030 */
110 sd->sensor = &po1030; 100 sd->sensor = &po1030;
@@ -137,7 +127,10 @@ int m5602_probe_sensor(struct sd *sd)
137 return -ENODEV; 127 return -ENODEV;
138} 128}
139 129
140int m5602_init(struct gspca_dev *gspca_dev) 130static int m5602_configure(struct gspca_dev *gspca_dev,
131 const struct usb_device_id *id);
132
133static int m5602_init(struct gspca_dev *gspca_dev)
141{ 134{
142 struct sd *sd = (struct sd *) gspca_dev; 135 struct sd *sd = (struct sd *) gspca_dev;
143 int err; 136 int err;
@@ -149,7 +142,7 @@ int m5602_init(struct gspca_dev *gspca_dev)
149 return err; 142 return err;
150} 143}
151 144
152void m5602_start_transfer(struct gspca_dev *gspca_dev) 145static int m5602_start_transfer(struct gspca_dev *gspca_dev)
153{ 146{
154 struct sd *sd = (struct sd *) gspca_dev; 147 struct sd *sd = (struct sd *) gspca_dev;
155 __u8 *buf = sd->gspca_dev.usb_buf; 148 __u8 *buf = sd->gspca_dev.usb_buf;
@@ -162,9 +155,11 @@ void m5602_start_transfer(struct gspca_dev *gspca_dev)
162 4, M5602_URB_MSG_TIMEOUT); 155 4, M5602_URB_MSG_TIMEOUT);
163 156
164 PDEBUG(DBG_V4L2, "Transfer started"); 157 PDEBUG(DBG_V4L2, "Transfer started");
158 return 0;
165} 159}
166 160
167void m5602_urb_complete(struct gspca_dev *gspca_dev, struct gspca_frame *frame, 161static void m5602_urb_complete(struct gspca_dev *gspca_dev,
162 struct gspca_frame *frame,
168 __u8 *data, int len) 163 __u8 *data, int len)
169{ 164{
170 struct sd *sd = (struct sd *) gspca_dev; 165 struct sd *sd = (struct sd *) gspca_dev;
@@ -216,13 +211,23 @@ void m5602_urb_complete(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
216 } 211 }
217} 212}
218 213
219void m5602_stop_transfer(struct gspca_dev *gspca_dev) 214static void m5602_stop_transfer(struct gspca_dev *gspca_dev)
220{ 215{
221 /* Is there are a command to stop a data transfer? */ 216 /* Is there are a command to stop a data transfer? */
222} 217}
223 218
219/* sub-driver description, the ctrl and nctrl is filled at probe time */
220static struct sd_desc sd_desc = {
221 .name = MODULE_NAME,
222 .config = m5602_configure,
223 .init = m5602_init,
224 .start = m5602_start_transfer,
225 .stopN = m5602_stop_transfer,
226 .pkt_scan = m5602_urb_complete
227};
228
224/* this function is called at probe time */ 229/* this function is called at probe time */
225int m5602_configure(struct gspca_dev *gspca_dev, 230static int m5602_configure(struct gspca_dev *gspca_dev,
226 const struct usb_device_id *id) 231 const struct usb_device_id *id)
227{ 232{
228 struct sd *sd = (struct sd *) gspca_dev; 233 struct sd *sd = (struct sd *) gspca_dev;