diff options
author | Paul Mackerras <paulus@samba.org> | 2008-09-09 21:36:13 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-09-09 21:36:13 -0400 |
commit | 7e392f8c29ee045c6a29d50193d2fb10712eceb0 (patch) | |
tree | c84097fe644c50c82f087ab7fa2d75167b8c0e16 /drivers/media/video/gspca/mars.c | |
parent | 7713fef06517d216f96ee7c8ad750e72bc08d38f (diff) | |
parent | 93811d94f7e9bcfeed7d6ba75ea5d9c80a70ab95 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/media/video/gspca/mars.c')
-rw-r--r-- | drivers/media/video/gspca/mars.c | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index 21c4ee56a10a..4d5db47ba8cb 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -100,22 +100,6 @@ static int reg_w(struct gspca_dev *gspca_dev, | |||
100 | return rc; | 100 | return rc; |
101 | } | 101 | } |
102 | 102 | ||
103 | static int reg_w_buf(struct gspca_dev *gspca_dev, | ||
104 | __u16 index, __u8 *buf, int len) | ||
105 | { | ||
106 | int rc; | ||
107 | |||
108 | rc = usb_control_msg(gspca_dev->dev, | ||
109 | usb_sndbulkpipe(gspca_dev->dev, 4), | ||
110 | 0x12, | ||
111 | 0xc8, /* ?? */ | ||
112 | 0, /* value */ | ||
113 | index, buf, len, 500); | ||
114 | if (rc < 0) | ||
115 | PDEBUG(D_ERR, "reg write [%02x] error %d", index, rc); | ||
116 | return rc; | ||
117 | } | ||
118 | |||
119 | static void bulk_w(struct gspca_dev *gspca_dev, | 103 | static void bulk_w(struct gspca_dev *gspca_dev, |
120 | __u16 *pch, | 104 | __u16 *pch, |
121 | __u16 Address) | 105 | __u16 Address) |
@@ -144,8 +128,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
144 | return 0; | 128 | return 0; |
145 | } | 129 | } |
146 | 130 | ||
147 | /* this function is called at open time */ | 131 | /* this function is called at probe and resume time */ |
148 | static int sd_open(struct gspca_dev *gspca_dev) | 132 | static int sd_init(struct gspca_dev *gspca_dev) |
149 | { | 133 | { |
150 | return 0; | 134 | return 0; |
151 | } | 135 | } |
@@ -175,7 +159,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
175 | /* | 159 | /* |
176 | Initialize the MR97113 chip register | 160 | Initialize the MR97113 chip register |
177 | */ | 161 | */ |
178 | data = kmalloc(16, GFP_KERNEL); | ||
179 | data[0] = 0x00; /* address */ | 162 | data[0] = 0x00; /* address */ |
180 | data[1] = 0x0c | 0x01; /* reg 0 */ | 163 | data[1] = 0x0c | 0x01; /* reg 0 */ |
181 | data[2] = 0x01; /* reg 1 */ | 164 | data[2] = 0x01; /* reg 1 */ |
@@ -195,12 +178,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
195 | data[10] = 0x5d; /* reg 9, I2C device address | 178 | data[10] = 0x5d; /* reg 9, I2C device address |
196 | * [for PAS5101 (0x40)] [for MI (0x5d)] */ | 179 | * [for PAS5101 (0x40)] [for MI (0x5d)] */ |
197 | 180 | ||
198 | err_code = reg_w_buf(gspca_dev, data[0], data, 11); | 181 | err_code = reg_w(gspca_dev, data[0], 11); |
199 | kfree(data); | ||
200 | if (err_code < 0) | 182 | if (err_code < 0) |
201 | return; | 183 | return; |
202 | 184 | ||
203 | data = gspca_dev->usb_buf; | ||
204 | data[0] = 0x23; /* address */ | 185 | data[0] = 0x23; /* address */ |
205 | data[1] = 0x09; /* reg 35, append frame header */ | 186 | data[1] = 0x09; /* reg 35, append frame header */ |
206 | 187 | ||
@@ -358,14 +339,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
358 | PDEBUG(D_ERR, "Camera Stop failed"); | 339 | PDEBUG(D_ERR, "Camera Stop failed"); |
359 | } | 340 | } |
360 | 341 | ||
361 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
362 | { | ||
363 | } | ||
364 | |||
365 | static void sd_close(struct gspca_dev *gspca_dev) | ||
366 | { | ||
367 | } | ||
368 | |||
369 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 342 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
370 | struct gspca_frame *frame, /* target */ | 343 | struct gspca_frame *frame, /* target */ |
371 | __u8 *data, /* isoc packet */ | 344 | __u8 *data, /* isoc packet */ |
@@ -411,11 +384,9 @@ static const struct sd_desc sd_desc = { | |||
411 | .ctrls = sd_ctrls, | 384 | .ctrls = sd_ctrls, |
412 | .nctrls = ARRAY_SIZE(sd_ctrls), | 385 | .nctrls = ARRAY_SIZE(sd_ctrls), |
413 | .config = sd_config, | 386 | .config = sd_config, |
414 | .open = sd_open, | 387 | .init = sd_init, |
415 | .start = sd_start, | 388 | .start = sd_start, |
416 | .stopN = sd_stopN, | 389 | .stopN = sd_stopN, |
417 | .stop0 = sd_stop0, | ||
418 | .close = sd_close, | ||
419 | .pkt_scan = sd_pkt_scan, | 390 | .pkt_scan = sd_pkt_scan, |
420 | }; | 391 | }; |
421 | 392 | ||
@@ -439,6 +410,10 @@ static struct usb_driver sd_driver = { | |||
439 | .id_table = device_table, | 410 | .id_table = device_table, |
440 | .probe = sd_probe, | 411 | .probe = sd_probe, |
441 | .disconnect = gspca_disconnect, | 412 | .disconnect = gspca_disconnect, |
413 | #ifdef CONFIG_PM | ||
414 | .suspend = gspca_suspend, | ||
415 | .resume = gspca_resume, | ||
416 | #endif | ||
442 | }; | 417 | }; |
443 | 418 | ||
444 | /* -- module insert / remove -- */ | 419 | /* -- module insert / remove -- */ |