diff options
| -rw-r--r-- | CHANGES | 10 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | bcm5974-dkms-mkdeb/debian/changelog | 7 | ||||
| -rw-r--r-- | bcm5974.c | 75 | ||||
| -rw-r--r-- | dkms.conf | 2 | ||||
| -rwxr-xr-x | scripts/bcm5974-diagnostics | 9 | ||||
| -rwxr-xr-x | scripts/bcm5974-pre-install | 7 |
7 files changed, 32 insertions, 80 deletions
| @@ -1,3 +1,13 @@ | |||
| 1 | bcm5974 (0.56) unstable; urgency=low | ||
| 2 | |||
| 3 | * Leave device initialization to hid; use mode-switch only | ||
| 4 | * Mode switch moved to atp_open and simplified | ||
| 5 | * Corrected cleanup action in atp_open | ||
| 6 | * Simplified control package detection | ||
| 7 | * Removed reset_resume, pre_reset, post_reset; not needed | ||
| 8 | |||
| 9 | -- Henrik Rydberg <rydberg@euromail.se> Fri, 18 Jul 2008 02:42:52 +0200 | ||
| 10 | |||
| 1 | bcm5974 (0.55) unstable; urgency=low | 11 | bcm5974 (0.55) unstable; urgency=low |
| 2 | 12 | ||
| 3 | * Package updates. | 13 | * Package updates. |
| @@ -1,5 +1,5 @@ | |||
| 1 | # | 1 | # |
| 2 | # Makefile for USB Network drivers | 2 | # Makefile for input/mouse drivers |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-m := bcm5974.o | 5 | obj-m := bcm5974.o |
diff --git a/bcm5974-dkms-mkdeb/debian/changelog b/bcm5974-dkms-mkdeb/debian/changelog index 1d4e435..cd60af8 100644 --- a/bcm5974-dkms-mkdeb/debian/changelog +++ b/bcm5974-dkms-mkdeb/debian/changelog | |||
| @@ -1,6 +1,9 @@ | |||
| 1 | MODULE_NAME-dkms (MODULE_VERSION) unstable; urgency=low | 1 | MODULE_NAME-dkms (MODULE_VERSION) unstable; urgency=low |
| 2 | 2 | ||
| 3 | * Package updates. | 3 | * Leave device initialization to hid; use mode-switch only |
| 4 | * Reverting GFP_ATOMIC for irq handlers. | 4 | * Mode switch moved to atp_open and simplified |
| 5 | * Corrected cleanup action in atp_open | ||
| 6 | * Simplified control package detection | ||
| 7 | * Removed reset_resume, pre_reset, post_reset; not needed | ||
| 5 | 8 | ||
| 6 | -- Henrik Rydberg <rydberg@euromail.se> DATE_STAMP | 9 | -- Henrik Rydberg <rydberg@euromail.se> DATE_STAMP |
| @@ -157,7 +157,6 @@ struct atp { | |||
| 157 | struct bt_data *bt_data; /* button transferred data */ | 157 | struct bt_data *bt_data; /* button transferred data */ |
| 158 | struct urb *tp_urb; /* trackpad usb request block */ | 158 | struct urb *tp_urb; /* trackpad usb request block */ |
| 159 | struct tp_data *tp_data; /* trackpad transferred data */ | 159 | struct tp_data *tp_data; /* trackpad transferred data */ |
| 160 | unsigned tp_valid; /* trackpad sensors valid */ | ||
| 161 | }; | 160 | }; |
| 162 | 161 | ||
| 163 | /* logical dimensions */ | 162 | /* logical dimensions */ |
| @@ -283,10 +282,9 @@ static int report_tp_state(struct atp *dev, int size) | |||
| 283 | #define ATP_WELLSPRING_MODE_WRITE_REQUEST_ID 9 | 282 | #define ATP_WELLSPRING_MODE_WRITE_REQUEST_ID 9 |
| 284 | #define ATP_WELLSPRING_MODE_REQUEST_VALUE 0x300 | 283 | #define ATP_WELLSPRING_MODE_REQUEST_VALUE 0x300 |
| 285 | #define ATP_WELLSPRING_MODE_REQUEST_INDEX 0 | 284 | #define ATP_WELLSPRING_MODE_REQUEST_INDEX 0 |
| 286 | #define ATP_WELLSPRING_MODE_VENDOR_VALUE_1 0x01 | 285 | #define ATP_WELLSPRING_MODE_VENDOR_VALUE 0x01 |
| 287 | #define ATP_WELLSPRING_MODE_VENDOR_VALUE_2 0x05 | ||
| 288 | 286 | ||
| 289 | static int atp_wellspring_init(struct atp *dev) | 287 | static int atp_wellspring_mode(struct atp *dev) |
| 290 | { | 288 | { |
| 291 | char *data = kmalloc(8, GFP_KERNEL); | 289 | char *data = kmalloc(8, GFP_KERNEL); |
| 292 | int error = 0, size; | 290 | int error = 0, size; |
| @@ -297,24 +295,6 @@ static int atp_wellspring_init(struct atp *dev) | |||
| 297 | goto error; | 295 | goto error; |
| 298 | } | 296 | } |
| 299 | 297 | ||
| 300 | /* reset button endpoint */ | ||
| 301 | if (usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), | ||
| 302 | USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, | ||
| 303 | 0, dev->cfg.bt_ep, NULL, 0, 5000)) { | ||
| 304 | err("bcm5974: could not reset button endpoint"); | ||
| 305 | error = -EIO; | ||
| 306 | goto error; | ||
| 307 | } | ||
| 308 | |||
| 309 | /* reset trackpad endpoint */ | ||
| 310 | if (usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), | ||
| 311 | USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, | ||
| 312 | 0, dev->cfg.tp_ep, NULL, 0, 5000)) { | ||
| 313 | err("bcm5974: could not reset trackpad endpoint"); | ||
| 314 | error = -EIO; | ||
| 315 | goto error; | ||
| 316 | } | ||
| 317 | |||
| 318 | /* read configuration */ | 298 | /* read configuration */ |
| 319 | size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), | 299 | size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), |
| 320 | ATP_WELLSPRING_MODE_READ_REQUEST_ID, | 300 | ATP_WELLSPRING_MODE_READ_REQUEST_ID, |
| @@ -329,8 +309,7 @@ static int atp_wellspring_init(struct atp *dev) | |||
| 329 | } | 309 | } |
| 330 | 310 | ||
| 331 | /* apply the mode switch */ | 311 | /* apply the mode switch */ |
| 332 | data[0] = ATP_WELLSPRING_MODE_VENDOR_VALUE_1; | 312 | data[0] = ATP_WELLSPRING_MODE_VENDOR_VALUE; |
| 333 | data[1] = ATP_WELLSPRING_MODE_VENDOR_VALUE_2; | ||
| 334 | 313 | ||
| 335 | /* write configuration */ | 314 | /* write configuration */ |
| 336 | size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), | 315 | size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), |
| @@ -345,9 +324,7 @@ static int atp_wellspring_init(struct atp *dev) | |||
| 345 | goto error; | 324 | goto error; |
| 346 | } | 325 | } |
| 347 | 326 | ||
| 348 | dev->tp_valid = 0; | 327 | dprintk(2, "bcm5974: switched to wellspring mode.\n"); |
| 349 | |||
| 350 | printk(KERN_INFO "bcm5974: Wellspring mode initialized.\n"); | ||
| 351 | 328 | ||
| 352 | kfree(data); | 329 | kfree(data); |
| 353 | return 0; | 330 | return 0; |
| @@ -409,11 +386,9 @@ static void irq_trackpad(struct urb *urb) | |||
| 409 | goto exit; | 386 | goto exit; |
| 410 | } | 387 | } |
| 411 | 388 | ||
| 412 | /* first sample data ignored */ | 389 | /* control response ignored */ |
| 413 | if (!dev->tp_valid) { | 390 | if (dev->tp_urb->actual_length == 2) |
| 414 | dev->tp_valid = 1; | ||
| 415 | goto exit; | 391 | goto exit; |
| 416 | } | ||
| 417 | 392 | ||
| 418 | if (report_tp_state(dev, dev->tp_urb->actual_length)) { | 393 | if (report_tp_state(dev, dev->tp_urb->actual_length)) { |
| 419 | dprintk(1, "bcm5974: bad trackpad package, length: %d\n", | 394 | dprintk(1, "bcm5974: bad trackpad package, length: %d\n", |
| @@ -434,18 +409,21 @@ static int atp_open(struct input_dev *input) | |||
| 434 | struct atp *dev = input_get_drvdata(input); | 409 | struct atp *dev = input_get_drvdata(input); |
| 435 | 410 | ||
| 436 | if (!dev->open) { | 411 | if (!dev->open) { |
| 412 | if (atp_wellspring_mode(dev)) | ||
| 413 | printk(KERN_INFO "bcm5974: mode switch failed\n"); | ||
| 414 | |||
| 437 | if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) | 415 | if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) |
| 438 | goto error; | 416 | goto error; |
| 439 | if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) | 417 | if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) |
| 440 | goto err_free_bt_urb; | 418 | goto err_kill_bt; |
| 441 | } | 419 | } |
| 442 | 420 | ||
| 443 | dev->open = 1; | 421 | dev->open = 1; |
| 444 | dev->suspended = 0; | 422 | dev->suspended = 0; |
| 445 | return 0; | 423 | return 0; |
| 446 | 424 | ||
| 447 | err_free_bt_urb: | 425 | err_kill_bt: |
| 448 | usb_free_urb(dev->bt_urb); | 426 | usb_kill_urb(dev->bt_urb); |
| 449 | error: | 427 | error: |
| 450 | return -EIO; | 428 | return -EIO; |
| 451 | } | 429 | } |
| @@ -486,12 +464,6 @@ static int atp_probe(struct usb_interface *iface, | |||
| 486 | dev->input = input_dev; | 464 | dev->input = input_dev; |
| 487 | dev->cfg = *cfg; | 465 | dev->cfg = *cfg; |
| 488 | 466 | ||
| 489 | /* switch to raw sensor mode */ | ||
| 490 | if (atp_wellspring_init(dev)) { | ||
| 491 | error = -EIO; | ||
| 492 | goto err_free_devs; | ||
| 493 | } | ||
| 494 | |||
| 495 | dev->bt_urb = usb_alloc_urb(0, GFP_KERNEL); | 467 | dev->bt_urb = usb_alloc_urb(0, GFP_KERNEL); |
| 496 | if (!dev->bt_urb) { | 468 | if (!dev->bt_urb) { |
| 497 | error = -ENOMEM; | 469 | error = -ENOMEM; |
| @@ -631,35 +603,12 @@ static int atp_resume(struct usb_interface *iface) | |||
| 631 | return error; | 603 | return error; |
| 632 | } | 604 | } |
| 633 | 605 | ||
| 634 | static int atp_reset_resume(struct usb_interface *iface) | ||
| 635 | { | ||
| 636 | struct atp *dev = usb_get_intfdata(iface); | ||
| 637 | |||
| 638 | if (dev && atp_wellspring_init(dev)) | ||
| 639 | printk(KERN_INFO "bcm5974: warning: reset failed\n"); | ||
| 640 | |||
| 641 | return atp_resume(iface); | ||
| 642 | } | ||
| 643 | |||
| 644 | static int atp_pre_reset(struct usb_interface *iface) | ||
| 645 | { | ||
| 646 | return atp_suspend(iface, PMSG_ON); | ||
| 647 | } | ||
| 648 | |||
| 649 | static int atp_post_reset(struct usb_interface *iface) | ||
| 650 | { | ||
| 651 | return atp_reset_resume(iface); | ||
| 652 | } | ||
| 653 | |||
| 654 | static struct usb_driver atp_driver = { | 606 | static struct usb_driver atp_driver = { |
| 655 | .name = "bcm5974", | 607 | .name = "bcm5974", |
| 656 | .probe = atp_probe, | 608 | .probe = atp_probe, |
| 657 | .disconnect = atp_disconnect, | 609 | .disconnect = atp_disconnect, |
| 658 | .suspend = atp_suspend, | 610 | .suspend = atp_suspend, |
| 659 | .resume = atp_resume, | 611 | .resume = atp_resume, |
| 660 | .reset_resume = atp_reset_resume, | ||
| 661 | .pre_reset = atp_pre_reset, | ||
| 662 | .post_reset = atp_post_reset, | ||
| 663 | .id_table = atp_table, | 612 | .id_table = atp_table, |
| 664 | }; | 613 | }; |
| 665 | 614 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | PACKAGE_NAME="bcm5974" | 1 | PACKAGE_NAME="bcm5974" |
| 2 | PACKAGE_VERSION="0.55" | 2 | PACKAGE_VERSION="0.56" |
| 3 | MAKE[0]="make -C ${kernel_source_dir} | 3 | MAKE[0]="make -C ${kernel_source_dir} |
| 4 | SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" | 4 | SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" |
| 5 | BUILT_MODULE_NAME[0]="bcm5974" | 5 | BUILT_MODULE_NAME[0]="bcm5974" |
diff --git a/scripts/bcm5974-diagnostics b/scripts/bcm5974-diagnostics index bacc02e..acd0bf4 100755 --- a/scripts/bcm5974-diagnostics +++ b/scripts/bcm5974-diagnostics | |||
| @@ -138,15 +138,6 @@ else | |||
| 138 | echo \* $DEVPATH: does not exist, ignore | 138 | echo \* $DEVPATH: does not exist, ignore |
| 139 | fi | 139 | fi |
| 140 | 140 | ||
| 141 | # Was the $DRIVER properly initialized? | ||
| 142 | WELLSPRING=`dmesg|grep $DRIVER|grep Wellspring` | ||
| 143 | if [ "$WELLSPRING" != "" ]; then | ||
| 144 | echo \* $DRIVER: Wellspring was initialized | ||
| 145 | else | ||
| 146 | echo \* $DRIVER: Wellspring was NOT initialized | ||
| 147 | exit 1 | ||
| 148 | fi | ||
| 149 | |||
| 150 | # Do we have synaptics working properly? | 141 | # Do we have synaptics working properly? |
| 151 | typeset -i SYNLINES=`synclient -l|wc -l` | 142 | typeset -i SYNLINES=`synclient -l|wc -l` |
| 152 | if [ $SYNLINES -gt 10 ]; then | 143 | if [ $SYNLINES -gt 10 ]; then |
diff --git a/scripts/bcm5974-pre-install b/scripts/bcm5974-pre-install index 3c4556e..1e2b864 100755 --- a/scripts/bcm5974-pre-install +++ b/scripts/bcm5974-pre-install | |||
| @@ -25,19 +25,18 @@ LSUSB=/usr/sbin/lsusb | |||
| 25 | PAT[0]="05ac:022" | 25 | PAT[0]="05ac:022" |
| 26 | PAT[1]="05ac:023" | 26 | PAT[1]="05ac:023" |
| 27 | 27 | ||
| 28 | #if [ -x $LSUSB ]; then | 28 | if [ -x $LSUSB ]; then |
| 29 | if true; then | ||
| 30 | if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then | 29 | if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then |
| 31 | exit 0 | 30 | exit 0 |
| 32 | elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then | 31 | elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then |
| 33 | exit 0 | 32 | exit 0 |
| 34 | else | 33 | else |
| 35 | echo bcm5974: no suitable device found | 34 | echo bcm5974: no suitable device found |
| 36 | exit 1 | 35 | exit -1 |
| 37 | fi | 36 | fi |
| 38 | else | 37 | else |
| 39 | echo bcm5974: cannot determine device type | 38 | echo bcm5974: cannot determine device type |
| 40 | exit 1 | 39 | exit -1 |
| 41 | fi | 40 | fi |
| 42 | 41 | ||
| 43 | exit 0 | 42 | exit 0 |
