diff options
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_bridge.h | 12 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_core.c | 37 |
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( | |||
167 | int m5602_write_bridge( | 167 | int m5602_write_bridge( |
168 | struct sd *sd, u8 address, u8 i2c_data); | 168 | struct sd *sd, u8 address, u8 i2c_data); |
169 | 169 | ||
170 | int m5602_configure(struct gspca_dev *gspca_dev, | ||
171 | const struct usb_device_id *id); | ||
172 | |||
173 | int m5602_init(struct gspca_dev *gspca_dev); | ||
174 | |||
175 | void m5602_start_transfer(struct gspca_dev *gspca_dev); | ||
176 | |||
177 | void m5602_stop_transfer(struct gspca_dev *gspca_dev); | ||
178 | |||
179 | void 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 | ||
36 | MODULE_DEVICE_TABLE(usb, m5602_table); | 36 | MODULE_DEVICE_TABLE(usb, m5602_table); |
37 | 37 | ||
38 | /* sub-driver description, the ctrl and nctrl is filled at probe time */ | ||
39 | static 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 */ |
49 | int m5602_read_bridge(struct sd *sd, u8 address, u8 *i2c_data) | 39 | int 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 | ||
107 | int m5602_probe_sensor(struct sd *sd) | 97 | static 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 | ||
140 | int m5602_init(struct gspca_dev *gspca_dev) | 130 | static int m5602_configure(struct gspca_dev *gspca_dev, |
131 | const struct usb_device_id *id); | ||
132 | |||
133 | static 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 | ||
152 | void m5602_start_transfer(struct gspca_dev *gspca_dev) | 145 | static 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 | ||
167 | void m5602_urb_complete(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | 161 | static 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 | ||
219 | void m5602_stop_transfer(struct gspca_dev *gspca_dev) | 214 | static 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 */ | ||
220 | static 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 */ |
225 | int m5602_configure(struct gspca_dev *gspca_dev, | 230 | static 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; |