Commit 8949d2aa05ddf5e9a31d738568a79915970cb38e
Committed by
Greg Kroah-Hartman
1 parent
2d8331792e
Exists in
master
and in
7 other branches
[PATCH] W1: Sync with w1/ds9490 tree.
Whitespace, static/nonstatic cleanups. Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 3 changed files with 99 additions and 96 deletions Side-by-side Diff
drivers/w1/ds_w1_bridge.c
1 | 1 | /* |
2 | - * ds_w1_bridge.c | |
2 | + * ds_w1_bridge.c | |
3 | 3 | * |
4 | 4 | * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru> |
5 | - * | |
6 | 5 | * |
6 | + * | |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | 9 | * the Free Software Foundation; either version 2 of the License, or |
... | ... | @@ -25,7 +25,7 @@ |
25 | 25 | #include "../w1/w1.h" |
26 | 26 | #include "../w1/w1_int.h" |
27 | 27 | #include "dscore.h" |
28 | - | |
28 | + | |
29 | 29 | static struct ds_device *ds_dev; |
30 | 30 | static struct w1_bus_master *ds_bus_master; |
31 | 31 | |
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | static int __devinit ds_w1_init(void) |
121 | 121 | { |
122 | 122 | int err; |
123 | - | |
123 | + | |
124 | 124 | ds_bus_master = kmalloc(sizeof(*ds_bus_master), GFP_KERNEL); |
125 | 125 | if (!ds_bus_master) { |
126 | 126 | printk(KERN_ERR "Failed to allocate DS9490R USB<->W1 bus_master structure.\n"); |
... | ... | @@ -136,14 +136,14 @@ |
136 | 136 | |
137 | 137 | memset(ds_bus_master, 0, sizeof(*ds_bus_master)); |
138 | 138 | |
139 | - ds_bus_master->data = (unsigned long)ds_dev; | |
140 | - ds_bus_master->touch_bit = &ds9490r_touch_bit; | |
141 | - ds_bus_master->read_bit = &ds9490r_read_bit; | |
142 | - ds_bus_master->write_bit = &ds9490r_write_bit; | |
143 | - ds_bus_master->read_byte = &ds9490r_read_byte; | |
144 | - ds_bus_master->write_byte = &ds9490r_write_byte; | |
145 | - ds_bus_master->read_block = &ds9490r_read_block; | |
146 | - ds_bus_master->write_block = &ds9490r_write_block; | |
139 | + ds_bus_master->data = (unsigned long)ds_dev; | |
140 | + ds_bus_master->touch_bit = &ds9490r_touch_bit; | |
141 | + ds_bus_master->read_bit = &ds9490r_read_bit; | |
142 | + ds_bus_master->write_bit = &ds9490r_write_bit; | |
143 | + ds_bus_master->read_byte = &ds9490r_read_byte; | |
144 | + ds_bus_master->write_byte = &ds9490r_write_byte; | |
145 | + ds_bus_master->read_block = &ds9490r_read_block; | |
146 | + ds_bus_master->write_block = &ds9490r_write_block; | |
147 | 147 | ds_bus_master->reset_bus = &ds9490r_reset; |
148 | 148 | |
149 | 149 | err = w1_add_master_device(ds_bus_master); |
drivers/w1/dscore.c
1 | 1 | /* |
2 | - * dscore.c | |
2 | + * dscore.c | |
3 | 3 | * |
4 | 4 | * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru> |
5 | - * | |
6 | 5 | * |
6 | + * | |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | 9 | * the Free Software Foundation; either version 2 of the License, or |
10 | 10 | |
11 | 11 | |
... | ... | @@ -32,19 +32,16 @@ |
32 | 32 | }; |
33 | 33 | MODULE_DEVICE_TABLE(usb, ds_id_table); |
34 | 34 | |
35 | -int ds_probe(struct usb_interface *, const struct usb_device_id *); | |
36 | -void ds_disconnect(struct usb_interface *); | |
35 | +static int ds_probe(struct usb_interface *, const struct usb_device_id *); | |
36 | +static void ds_disconnect(struct usb_interface *); | |
37 | 37 | |
38 | 38 | int ds_touch_bit(struct ds_device *, u8, u8 *); |
39 | 39 | int ds_read_byte(struct ds_device *, u8 *); |
40 | 40 | int ds_read_bit(struct ds_device *, u8 *); |
41 | 41 | int ds_write_byte(struct ds_device *, u8); |
42 | 42 | int ds_write_bit(struct ds_device *, u8); |
43 | -int ds_start_pulse(struct ds_device *, int); | |
44 | -int ds_set_speed(struct ds_device *, int); | |
43 | +static int ds_start_pulse(struct ds_device *, int); | |
45 | 44 | int ds_reset(struct ds_device *, struct ds_status *); |
46 | -int ds_detect(struct ds_device *, struct ds_status *); | |
47 | -int ds_stop_pulse(struct ds_device *, int); | |
48 | 45 | struct ds_device * ds_get_device(void); |
49 | 46 | void ds_put_device(struct ds_device *); |
50 | 47 | |
51 | 48 | |
... | ... | @@ -79,11 +76,11 @@ |
79 | 76 | static int ds_send_control_cmd(struct ds_device *dev, u16 value, u16 index) |
80 | 77 | { |
81 | 78 | int err; |
82 | - | |
83 | - err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
79 | + | |
80 | + err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
84 | 81 | CONTROL_CMD, 0x40, value, index, NULL, 0, 1000); |
85 | 82 | if (err < 0) { |
86 | - printk(KERN_ERR "Failed to send command control message %x.%x: err=%d.\n", | |
83 | + printk(KERN_ERR "Failed to send command control message %x.%x: err=%d.\n", | |
87 | 84 | value, index, err); |
88 | 85 | return err; |
89 | 86 | } |
90 | 87 | |
... | ... | @@ -94,11 +91,11 @@ |
94 | 91 | static int ds_send_control_mode(struct ds_device *dev, u16 value, u16 index) |
95 | 92 | { |
96 | 93 | int err; |
97 | - | |
98 | - err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
94 | + | |
95 | + err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
99 | 96 | MODE_CMD, 0x40, value, index, NULL, 0, 1000); |
100 | 97 | if (err < 0) { |
101 | - printk(KERN_ERR "Failed to send mode control message %x.%x: err=%d.\n", | |
98 | + printk(KERN_ERR "Failed to send mode control message %x.%x: err=%d.\n", | |
102 | 99 | value, index, err); |
103 | 100 | return err; |
104 | 101 | } |
105 | 102 | |
... | ... | @@ -109,11 +106,11 @@ |
109 | 106 | static int ds_send_control(struct ds_device *dev, u16 value, u16 index) |
110 | 107 | { |
111 | 108 | int err; |
112 | - | |
113 | - err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
109 | + | |
110 | + err = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, dev->ep[EP_CONTROL]), | |
114 | 111 | COMM_CMD, 0x40, value, index, NULL, 0, 1000); |
115 | 112 | if (err < 0) { |
116 | - printk(KERN_ERR "Failed to send control message %x.%x: err=%d.\n", | |
113 | + printk(KERN_ERR "Failed to send control message %x.%x: err=%d.\n", | |
117 | 114 | value, index, err); |
118 | 115 | return err; |
119 | 116 | } |
120 | 117 | |
121 | 118 | |
122 | 119 | |
... | ... | @@ -126,19 +123,20 @@ |
126 | 123 | printk("%45s: %8x\n", str, buf[off]); |
127 | 124 | } |
128 | 125 | |
129 | -int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st, unsigned char *buf, int size) | |
126 | +static int ds_recv_status_nodump(struct ds_device *dev, struct ds_status *st, | |
127 | + unsigned char *buf, int size) | |
130 | 128 | { |
131 | 129 | int count, err; |
132 | - | |
130 | + | |
133 | 131 | memset(st, 0, sizeof(st)); |
134 | - | |
132 | + | |
135 | 133 | count = 0; |
136 | 134 | err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_STATUS]), buf, size, &count, 100); |
137 | 135 | if (err < 0) { |
138 | 136 | printk(KERN_ERR "Failed to read 1-wire data from 0x%x: err=%d.\n", dev->ep[EP_STATUS], err); |
139 | 137 | return err; |
140 | 138 | } |
141 | - | |
139 | + | |
142 | 140 | if (count >= sizeof(*st)) |
143 | 141 | memcpy(st, buf, sizeof(*st)); |
144 | 142 | |
145 | 143 | |
146 | 144 | |
... | ... | @@ -149,13 +147,13 @@ |
149 | 147 | { |
150 | 148 | unsigned char buf[64]; |
151 | 149 | int count, err = 0, i; |
152 | - | |
150 | + | |
153 | 151 | memcpy(st, buf, sizeof(*st)); |
154 | - | |
152 | + | |
155 | 153 | count = ds_recv_status_nodump(dev, st, buf, sizeof(buf)); |
156 | 154 | if (count < 0) |
157 | 155 | return err; |
158 | - | |
156 | + | |
159 | 157 | printk("0x%x: count=%d, status: ", dev->ep[EP_STATUS], count); |
160 | 158 | for (i=0; i<count; ++i) |
161 | 159 | printk("%02x ", buf[i]); |
... | ... | @@ -199,7 +197,7 @@ |
199 | 197 | return err; |
200 | 198 | } |
201 | 199 | #endif |
202 | - | |
200 | + | |
203 | 201 | return err; |
204 | 202 | } |
205 | 203 | |
206 | 204 | |
... | ... | @@ -207,9 +205,9 @@ |
207 | 205 | { |
208 | 206 | int count, err; |
209 | 207 | struct ds_status st; |
210 | - | |
208 | + | |
211 | 209 | count = 0; |
212 | - err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN]), | |
210 | + err = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->ep[EP_DATA_IN]), | |
213 | 211 | buf, size, &count, 1000); |
214 | 212 | if (err < 0) { |
215 | 213 | printk(KERN_INFO "Clearing ep0x%x.\n", dev->ep[EP_DATA_IN]); |
... | ... | @@ -234,7 +232,7 @@ |
234 | 232 | static int ds_send_data(struct ds_device *dev, unsigned char *buf, int len) |
235 | 233 | { |
236 | 234 | int count, err; |
237 | - | |
235 | + | |
238 | 236 | count = 0; |
239 | 237 | err = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, dev->ep[EP_DATA_OUT]), buf, len, &count, 1000); |
240 | 238 | if (err < 0) { |
241 | 239 | |
... | ... | @@ -245,12 +243,14 @@ |
245 | 243 | return err; |
246 | 244 | } |
247 | 245 | |
246 | +#if 0 | |
247 | + | |
248 | 248 | int ds_stop_pulse(struct ds_device *dev, int limit) |
249 | 249 | { |
250 | 250 | struct ds_status st; |
251 | 251 | int count = 0, err = 0; |
252 | 252 | u8 buf[0x20]; |
253 | - | |
253 | + | |
254 | 254 | do { |
255 | 255 | err = ds_send_control(dev, CTL_HALT_EXE_IDLE, 0); |
256 | 256 | if (err) |
... | ... | @@ -275,7 +275,7 @@ |
275 | 275 | int ds_detect(struct ds_device *dev, struct ds_status *st) |
276 | 276 | { |
277 | 277 | int err; |
278 | - | |
278 | + | |
279 | 279 | err = ds_send_control_cmd(dev, CTL_RESET_DEVICE, 0); |
280 | 280 | if (err) |
281 | 281 | return err; |
282 | 282 | |
... | ... | @@ -283,11 +283,11 @@ |
283 | 283 | err = ds_send_control(dev, COMM_SET_DURATION | COMM_IM, 0); |
284 | 284 | if (err) |
285 | 285 | return err; |
286 | - | |
286 | + | |
287 | 287 | err = ds_send_control(dev, COMM_SET_DURATION | COMM_IM | COMM_TYPE, 0x40); |
288 | 288 | if (err) |
289 | 289 | return err; |
290 | - | |
290 | + | |
291 | 291 | err = ds_send_control_mode(dev, MOD_PULSE_EN, PULSE_PROG); |
292 | 292 | if (err) |
293 | 293 | return err; |
... | ... | @@ -297,7 +297,9 @@ |
297 | 297 | return err; |
298 | 298 | } |
299 | 299 | |
300 | -int ds_wait_status(struct ds_device *dev, struct ds_status *st) | |
300 | +#endif /* 0 */ | |
301 | + | |
302 | +static int ds_wait_status(struct ds_device *dev, struct ds_status *st) | |
301 | 303 | { |
302 | 304 | u8 buf[0x20]; |
303 | 305 | int err, count = 0; |
... | ... | @@ -305,7 +307,7 @@ |
305 | 307 | do { |
306 | 308 | err = ds_recv_status_nodump(dev, st, buf, sizeof(buf)); |
307 | 309 | #if 0 |
308 | - if (err >= 0) { | |
310 | + if (err >= 0) { | |
309 | 311 | int i; |
310 | 312 | printk("0x%x: count=%d, status: ", dev->ep[EP_STATUS], err); |
311 | 313 | for (i=0; i<err; ++i) |
312 | 314 | |
... | ... | @@ -319,10 +321,8 @@ |
319 | 321 | if (((err > 16) && (buf[0x10] & 0x01)) || count >= 100 || err < 0) { |
320 | 322 | ds_recv_status(dev, st); |
321 | 323 | return -1; |
322 | - } | |
323 | - else { | |
324 | + } else | |
324 | 325 | return 0; |
325 | - } | |
326 | 326 | } |
327 | 327 | |
328 | 328 | int ds_reset(struct ds_device *dev, struct ds_status *st) |
... | ... | @@ -345,6 +345,7 @@ |
345 | 345 | return 0; |
346 | 346 | } |
347 | 347 | |
348 | +#if 0 | |
348 | 349 | int ds_set_speed(struct ds_device *dev, int speed) |
349 | 350 | { |
350 | 351 | int err; |
351 | 352 | |
352 | 353 | |
353 | 354 | |
... | ... | @@ -356,20 +357,21 @@ |
356 | 357 | speed = SPEED_FLEXIBLE; |
357 | 358 | |
358 | 359 | speed &= 0xff; |
359 | - | |
360 | + | |
360 | 361 | err = ds_send_control_mode(dev, MOD_1WIRE_SPEED, speed); |
361 | 362 | if (err) |
362 | 363 | return err; |
363 | 364 | |
364 | 365 | return err; |
365 | 366 | } |
367 | +#endif /* 0 */ | |
366 | 368 | |
367 | -int ds_start_pulse(struct ds_device *dev, int delay) | |
369 | +static int ds_start_pulse(struct ds_device *dev, int delay) | |
368 | 370 | { |
369 | 371 | int err; |
370 | 372 | u8 del = 1 + (u8)(delay >> 4); |
371 | 373 | struct ds_status st; |
372 | - | |
374 | + | |
373 | 375 | #if 0 |
374 | 376 | err = ds_stop_pulse(dev, 10); |
375 | 377 | if (err) |
... | ... | @@ -390,7 +392,7 @@ |
390 | 392 | mdelay(delay); |
391 | 393 | |
392 | 394 | ds_wait_status(dev, &st); |
393 | - | |
395 | + | |
394 | 396 | return err; |
395 | 397 | } |
396 | 398 | |
... | ... | @@ -400,7 +402,7 @@ |
400 | 402 | struct ds_status st; |
401 | 403 | u16 value = (COMM_BIT_IO | COMM_IM) | ((bit) ? COMM_D : 0); |
402 | 404 | u16 cmd; |
403 | - | |
405 | + | |
404 | 406 | err = ds_send_control(dev, value, 0); |
405 | 407 | if (err) |
406 | 408 | return err; |
... | ... | @@ -430,7 +432,7 @@ |
430 | 432 | { |
431 | 433 | int err; |
432 | 434 | struct ds_status st; |
433 | - | |
435 | + | |
434 | 436 | err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | (bit) ? COMM_D : 0, 0); |
435 | 437 | if (err) |
436 | 438 | return err; |
... | ... | @@ -445,7 +447,7 @@ |
445 | 447 | int err; |
446 | 448 | struct ds_status st; |
447 | 449 | u8 rbyte; |
448 | - | |
450 | + | |
449 | 451 | err = ds_send_control(dev, COMM_BYTE_IO | COMM_IM | COMM_SPU, byte); |
450 | 452 | if (err) |
451 | 453 | return err; |
452 | 454 | |
... | ... | @@ -453,11 +455,11 @@ |
453 | 455 | err = ds_wait_status(dev, &st); |
454 | 456 | if (err) |
455 | 457 | return err; |
456 | - | |
458 | + | |
457 | 459 | err = ds_recv_data(dev, &rbyte, sizeof(rbyte)); |
458 | 460 | if (err < 0) |
459 | 461 | return err; |
460 | - | |
462 | + | |
461 | 463 | ds_start_pulse(dev, PULLUP_PULSE_DURATION); |
462 | 464 | |
463 | 465 | return !(byte == rbyte); |
464 | 466 | |
... | ... | @@ -470,11 +472,11 @@ |
470 | 472 | err = ds_send_control_mode(dev, MOD_PULSE_EN, PULSE_SPUE); |
471 | 473 | if (err) |
472 | 474 | return err; |
473 | - | |
475 | + | |
474 | 476 | err = ds_send_control(dev, COMM_BIT_IO | COMM_IM | COMM_SPU | COMM_D, 0); |
475 | 477 | if (err) |
476 | 478 | return err; |
477 | - | |
479 | + | |
478 | 480 | err = ds_recv_data(dev, bit, sizeof(*bit)); |
479 | 481 | if (err < 0) |
480 | 482 | return err; |
... | ... | @@ -492,7 +494,7 @@ |
492 | 494 | return err; |
493 | 495 | |
494 | 496 | ds_wait_status(dev, &st); |
495 | - | |
497 | + | |
496 | 498 | err = ds_recv_data(dev, byte, sizeof(*byte)); |
497 | 499 | if (err < 0) |
498 | 500 | return err; |
499 | 501 | |
500 | 502 | |
... | ... | @@ -509,17 +511,17 @@ |
509 | 511 | return -E2BIG; |
510 | 512 | |
511 | 513 | memset(buf, 0xFF, len); |
512 | - | |
514 | + | |
513 | 515 | err = ds_send_data(dev, buf, len); |
514 | 516 | if (err < 0) |
515 | 517 | return err; |
516 | - | |
518 | + | |
517 | 519 | err = ds_send_control(dev, COMM_BLOCK_IO | COMM_IM | COMM_SPU, len); |
518 | 520 | if (err) |
519 | 521 | return err; |
520 | 522 | |
521 | 523 | ds_wait_status(dev, &st); |
522 | - | |
524 | + | |
523 | 525 | memset(buf, 0x00, len); |
524 | 526 | err = ds_recv_data(dev, buf, len); |
525 | 527 | |
526 | 528 | |
... | ... | @@ -530,11 +532,11 @@ |
530 | 532 | { |
531 | 533 | int err; |
532 | 534 | struct ds_status st; |
533 | - | |
535 | + | |
534 | 536 | err = ds_send_data(dev, buf, len); |
535 | 537 | if (err < 0) |
536 | 538 | return err; |
537 | - | |
539 | + | |
538 | 540 | ds_wait_status(dev, &st); |
539 | 541 | |
540 | 542 | err = ds_send_control(dev, COMM_BLOCK_IO | COMM_IM | COMM_SPU, len); |
541 | 543 | |
... | ... | @@ -548,10 +550,12 @@ |
548 | 550 | return err; |
549 | 551 | |
550 | 552 | ds_start_pulse(dev, PULLUP_PULSE_DURATION); |
551 | - | |
553 | + | |
552 | 554 | return !(err == len); |
553 | 555 | } |
554 | 556 | |
557 | +#if 0 | |
558 | + | |
555 | 559 | int ds_search(struct ds_device *dev, u64 init, u64 *buf, u8 id_number, int conditional_search) |
556 | 560 | { |
557 | 561 | int err; |
558 | 562 | |
... | ... | @@ -559,11 +563,11 @@ |
559 | 563 | struct ds_status st; |
560 | 564 | |
561 | 565 | memset(buf, 0, sizeof(buf)); |
562 | - | |
566 | + | |
563 | 567 | err = ds_send_data(ds_dev, (unsigned char *)&init, 8); |
564 | 568 | if (err) |
565 | 569 | return err; |
566 | - | |
570 | + | |
567 | 571 | ds_wait_status(ds_dev, &st); |
568 | 572 | |
569 | 573 | value = COMM_SEARCH_ACCESS | COMM_IM | COMM_SM | COMM_F | COMM_RTS; |
... | ... | @@ -589,7 +593,7 @@ |
589 | 593 | err = ds_send_data(dev, (unsigned char *)&init, sizeof(init)); |
590 | 594 | if (err) |
591 | 595 | return err; |
592 | - | |
596 | + | |
593 | 597 | ds_wait_status(dev, &st); |
594 | 598 | |
595 | 599 | err = ds_send_control(dev, COMM_MATCH_ACCESS | COMM_IM | COMM_RST, 0x0055); |
596 | 600 | |
... | ... | @@ -609,11 +613,11 @@ |
609 | 613 | |
610 | 614 | memcpy(buf, &init, 8); |
611 | 615 | buf[8] = BRANCH_MAIN; |
612 | - | |
616 | + | |
613 | 617 | err = ds_send_data(dev, buf, sizeof(buf)); |
614 | 618 | if (err) |
615 | 619 | return err; |
616 | - | |
620 | + | |
617 | 621 | ds_wait_status(dev, &st); |
618 | 622 | |
619 | 623 | err = ds_send_control(dev, COMM_SET_PATH | COMM_IM | COMM_RST, 0); |
... | ... | @@ -625,7 +629,10 @@ |
625 | 629 | return 0; |
626 | 630 | } |
627 | 631 | |
628 | -int ds_probe(struct usb_interface *intf, const struct usb_device_id *udev_id) | |
632 | +#endif /* 0 */ | |
633 | + | |
634 | +static int ds_probe(struct usb_interface *intf, | |
635 | + const struct usb_device_id *udev_id) | |
629 | 636 | { |
630 | 637 | struct usb_device *udev = interface_to_usbdev(intf); |
631 | 638 | struct usb_endpoint_descriptor *endpoint; |
... | ... | @@ -653,7 +660,7 @@ |
653 | 660 | printk(KERN_ERR "Failed to reset configuration: err=%d.\n", err); |
654 | 661 | return err; |
655 | 662 | } |
656 | - | |
663 | + | |
657 | 664 | iface_desc = &intf->altsetting[0]; |
658 | 665 | if (iface_desc->desc.bNumEndpoints != NUM_EP-1) { |
659 | 666 | printk(KERN_INFO "Num endpoints=%d. It is not DS9490R.\n", iface_desc->desc.bNumEndpoints); |
660 | 667 | |
661 | 668 | |
662 | 669 | |
663 | 670 | |
664 | 671 | |
... | ... | @@ -662,37 +669,37 @@ |
662 | 669 | |
663 | 670 | atomic_set(&ds_dev->refcnt, 0); |
664 | 671 | memset(ds_dev->ep, 0, sizeof(ds_dev->ep)); |
665 | - | |
672 | + | |
666 | 673 | /* |
667 | - * This loop doesn'd show control 0 endpoint, | |
674 | + * This loop doesn'd show control 0 endpoint, | |
668 | 675 | * so we will fill only 1-3 endpoints entry. |
669 | 676 | */ |
670 | 677 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { |
671 | 678 | endpoint = &iface_desc->endpoint[i].desc; |
672 | 679 | |
673 | 680 | ds_dev->ep[i+1] = endpoint->bEndpointAddress; |
674 | - | |
681 | + | |
675 | 682 | printk("%d: addr=%x, size=%d, dir=%s, type=%x\n", |
676 | 683 | i, endpoint->bEndpointAddress, le16_to_cpu(endpoint->wMaxPacketSize), |
677 | 684 | (endpoint->bEndpointAddress & USB_DIR_IN)?"IN":"OUT", |
678 | 685 | endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK); |
679 | 686 | } |
680 | - | |
687 | + | |
681 | 688 | #if 0 |
682 | 689 | { |
683 | 690 | int err, i; |
684 | 691 | u64 buf[3]; |
685 | 692 | u64 init=0xb30000002078ee81ull; |
686 | 693 | struct ds_status st; |
687 | - | |
694 | + | |
688 | 695 | ds_reset(ds_dev, &st); |
689 | 696 | err = ds_search(ds_dev, init, buf, 3, 0); |
690 | 697 | if (err < 0) |
691 | 698 | return err; |
692 | 699 | for (i=0; i<err; ++i) |
693 | 700 | printk("%d: %llx\n", i, buf[i]); |
694 | - | |
695 | - printk("Resetting...\n"); | |
701 | + | |
702 | + printk("Resetting...\n"); | |
696 | 703 | ds_reset(ds_dev, &st); |
697 | 704 | printk("Setting path for %llx.\n", init); |
698 | 705 | err = ds_set_path(ds_dev, init); |
699 | 706 | |
... | ... | @@ -707,12 +714,12 @@ |
707 | 714 | err = ds_search(ds_dev, init, buf, 3, 0); |
708 | 715 | |
709 | 716 | printk("ds_search() returned %d\n", err); |
710 | - | |
717 | + | |
711 | 718 | if (err < 0) |
712 | 719 | return err; |
713 | 720 | for (i=0; i<err; ++i) |
714 | 721 | printk("%d: %llx\n", i, buf[i]); |
715 | - | |
722 | + | |
716 | 723 | return 0; |
717 | 724 | } |
718 | 725 | #endif |
719 | 726 | |
... | ... | @@ -720,10 +727,10 @@ |
720 | 727 | return 0; |
721 | 728 | } |
722 | 729 | |
723 | -void ds_disconnect(struct usb_interface *intf) | |
730 | +static void ds_disconnect(struct usb_interface *intf) | |
724 | 731 | { |
725 | 732 | struct ds_device *dev; |
726 | - | |
733 | + | |
727 | 734 | dev = usb_get_intfdata(intf); |
728 | 735 | usb_set_intfdata(intf, NULL); |
729 | 736 | |
... | ... | @@ -740,7 +747,7 @@ |
740 | 747 | ds_dev = NULL; |
741 | 748 | } |
742 | 749 | |
743 | -int ds_init(void) | |
750 | +static int ds_init(void) | |
744 | 751 | { |
745 | 752 | int err; |
746 | 753 | |
... | ... | @@ -753,7 +760,7 @@ |
753 | 760 | return 0; |
754 | 761 | } |
755 | 762 | |
756 | -void ds_fini(void) | |
763 | +static void ds_fini(void) | |
757 | 764 | { |
758 | 765 | usb_deregister(&ds_driver); |
759 | 766 | } |
... | ... | @@ -776,8 +783,8 @@ |
776 | 783 | EXPORT_SYMBOL(ds_put_device); |
777 | 784 | |
778 | 785 | /* |
779 | - * This functions can be used for EEPROM programming, | |
780 | - * when driver will be included into mainline this will | |
786 | + * This functions can be used for EEPROM programming, | |
787 | + * when driver will be included into mainline this will | |
781 | 788 | * require uncommenting. |
782 | 789 | */ |
783 | 790 | #if 0 |
drivers/w1/dscore.h
1 | 1 | /* |
2 | - * dscore.h | |
2 | + * dscore.h | |
3 | 3 | * |
4 | 4 | * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru> |
5 | - * | |
6 | 5 | * |
6 | + * | |
7 | 7 | * This program is free software; you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | 9 | * the Free Software Foundation; either version 2 of the License, or |
... | ... | @@ -122,7 +122,7 @@ |
122 | 122 | |
123 | 123 | struct ds_device |
124 | 124 | { |
125 | - struct usb_device *udev; | |
125 | + struct usb_device *udev; | |
126 | 126 | struct usb_interface *intf; |
127 | 127 | |
128 | 128 | int ep[NUM_EP]; |
129 | 129 | |
... | ... | @@ -156,11 +156,7 @@ |
156 | 156 | int ds_read_bit(struct ds_device *, u8 *); |
157 | 157 | int ds_write_byte(struct ds_device *, u8); |
158 | 158 | int ds_write_bit(struct ds_device *, u8); |
159 | -int ds_start_pulse(struct ds_device *, int); | |
160 | -int ds_set_speed(struct ds_device *, int); | |
161 | 159 | int ds_reset(struct ds_device *, struct ds_status *); |
162 | -int ds_detect(struct ds_device *, struct ds_status *); | |
163 | -int ds_stop_pulse(struct ds_device *, int); | |
164 | 160 | struct ds_device * ds_get_device(void); |
165 | 161 | void ds_put_device(struct ds_device *); |
166 | 162 | int ds_write_block(struct ds_device *, u8 *, int); |