From d7e13b9eb682d7008b94d050ad35804d46f76750 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 8 Oct 2008 23:19:56 +0200 Subject: bcm5974 (0.52) unstable; urgency=low * Typo in the post-install script. -- Henrik Rydberg Mon, 07 Jul 2008 20:09:39 +0200 --- scripts/bcm5974-diagnostics | 2 +- scripts/bcm5974-post-install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bcm5974-diagnostics b/scripts/bcm5974-diagnostics index 0322158..bacc02e 100755 --- a/scripts/bcm5974-diagnostics +++ b/scripts/bcm5974-diagnostics @@ -131,7 +131,7 @@ if [ -f $DEVPATH ]; then echo \* $DEVPATH: module is registered else echo \* $DEVPATH: module is NOT registered - echo No help on this one... + echo "Please double-check the quirks settings in $DRIVMOD" exit 1 fi else diff --git a/scripts/bcm5974-post-install b/scripts/bcm5974-post-install index 21e989e..bf3f74f 100755 --- a/scripts/bcm5974-post-install +++ b/scripts/bcm5974-post-install @@ -29,7 +29,7 @@ PAT_HEAD="options usbhid quirks=" PAT_MBA="0x05ac:0x022" PAT_MBP="0x05ac:0x023" MATCH_MBA=$PAT_HEAD$PAT_MBA -MATCH_MBB=$PAT_HEAD$PAT_MBB +MATCH_MBP=$PAT_HEAD$PAT_MBP if [ -x /usr/sbin/lsusb ]; then if [ "lsusb|grep $PAT_MBA" != "" ]; then -- cgit v1.2.3 From 6aa1bd4e2935d2aa770e841b607850304092f5f8 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 8 Oct 2008 23:21:01 +0200 Subject: bcm5974 (0.53) unstable; urgency=low * Another typo in the post-install script. -- Henrik Rydberg Mon, 07 Jul 2008 20:59:39 +0200 --- CHANGES | 5 +++++ dkms.conf | 2 +- scripts/bcm5974-post-install | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/CHANGES b/CHANGES index 1e4583f..bcb0867 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +07JUL2008 version 0.53 +---------------------- + +Another typo in the post-install script. + 07JUL2008 version 0.52 ---------------------- diff --git a/dkms.conf b/dkms.conf index ff1cdf2..35e8af8 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="bcm5974" -PACKAGE_VERSION="0.52" +PACKAGE_VERSION="0.53" MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" BUILT_MODULE_NAME[0]="bcm5974" diff --git a/scripts/bcm5974-post-install b/scripts/bcm5974-post-install index bf3f74f..8c71be0 100755 --- a/scripts/bcm5974-post-install +++ b/scripts/bcm5974-post-install @@ -34,7 +34,7 @@ MATCH_MBP=$PAT_HEAD$PAT_MBP if [ -x /usr/sbin/lsusb ]; then if [ "lsusb|grep $PAT_MBA" != "" ]; then SED="s/#$MATCH_MBA/$MATCH_MBA/" - elif [ $has_mbb -gt 0 ]; then + elif [ "lsusb|grep $PAT_MBP" != "" ]; then SED="s/#$MATCH_MBP/$MATCH_MBP/" else echo No suitable device found -- cgit v1.2.3 From f9a35c63d6114a9c922bf3b84233e74b61f99f10 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 8 Oct 2008 23:21:44 +0200 Subject: bcm5974 (0.54) unstable; urgency=low * And another one... finally got the bright idea to test it by emulating the different product ids. -- Henrik Rydberg Tue, 08 Jul 2008 20:59:39 +0200 --- CHANGES | 6 ++++++ bcm5974.c | 4 ++-- dkms.conf | 2 +- scripts/bcm5974-post-install | 20 +++++++++++--------- 4 files changed, 20 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/CHANGES b/CHANGES index bcb0867..8512d87 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +08JUL2008 version 0.54 +---------------------- + +And another one... finally got the bright idea to test it by emulating +the different product ids. + 07JUL2008 version 0.53 ---------------------- diff --git a/bcm5974.c b/bcm5974.c index e1876c6..4d9dd45 100644 --- a/bcm5974.c +++ b/bcm5974.c @@ -192,8 +192,8 @@ static const struct atp_config atp_config_table[] = { 0x81, sizeof(struct tp_data), { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 }, { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, - { DIM_X, DIM_X / SN_COORD, -4824, 5342 }, - { DIM_Y, DIM_Y / SN_COORD, -172, 5820 } + { DIM_X, DIM_X / SN_COORD, -4824, 4824 }, + { DIM_Y, DIM_Y / SN_COORD, -172, 4290 } }, {} }; diff --git a/dkms.conf b/dkms.conf index 35e8af8..cb169d6 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="bcm5974" -PACKAGE_VERSION="0.53" +PACKAGE_VERSION="0.54" MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" BUILT_MODULE_NAME[0]="bcm5974" diff --git a/scripts/bcm5974-post-install b/scripts/bcm5974-post-install index 8c71be0..5674d40 100755 --- a/scripts/bcm5974-post-install +++ b/scripts/bcm5974-post-install @@ -25,17 +25,19 @@ ETCPATH=/etc/modprobe.d/$DRIVER echo ----------------------------------------------------------------------- DIR=`dirname $0` +LSUSB=/usr/sbin/lsusb + PAT_HEAD="options usbhid quirks=" -PAT_MBA="0x05ac:0x022" -PAT_MBP="0x05ac:0x023" -MATCH_MBA=$PAT_HEAD$PAT_MBA -MATCH_MBP=$PAT_HEAD$PAT_MBP +PAT[0]="05ac:022" +PAT[1]="05ac:023" +MATCH[0]=${PAT_HEAD}0x05ac:0x022 +MATCH[1]=${PAT_HEAD}0x05ac:0x023 -if [ -x /usr/sbin/lsusb ]; then - if [ "lsusb|grep $PAT_MBA" != "" ]; then - SED="s/#$MATCH_MBA/$MATCH_MBA/" - elif [ "lsusb|grep $PAT_MBP" != "" ]; then - SED="s/#$MATCH_MBP/$MATCH_MBP/" +if [ -x $LSUSB ]; then + if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then + SED="s/#${MATCH[0]}/${MATCH[0]}/" + elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then + SED="s/#${MATCH[1]}/${MATCH[1]}/" else echo No suitable device found exit 1 -- cgit v1.2.3 From 7285547e67f8924aace7a78773fa57f9b8fd5bd7 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 8 Oct 2008 23:25:53 +0200 Subject: bcm5974 (0.55) unstable; urgency=low * Package updates. * Reverting GFP_ATOMIC for irq handlers. -- Henrik Rydberg Wed, 09 Jul 2008 20:59:39 +0200 --- CHANGES | 120 +++++++++++++++++++------------- INSTALL | 2 +- bcm5974-dkms-mkdeb/debian/README.Debian | 23 ++++-- bcm5974-dkms-mkdeb/debian/changelog | 4 +- bcm5974-dkms-mkdeb/debian/control | 5 ++ bcm5974-dkms-mkdeb/debian/copyright | 41 ++++++++++- bcm5974-dkms-mkdeb/debian/dirs | 1 - bcm5974.c | 6 +- dkms.conf | 3 +- scripts/bcm5974-pre-install | 43 ++++++++++++ 10 files changed, 185 insertions(+), 63 deletions(-) create mode 100755 scripts/bcm5974-pre-install (limited to 'scripts') diff --git a/CHANGES b/CHANGES index 8512d87..6e51394 100644 --- a/CHANGES +++ b/CHANGES @@ -1,78 +1,102 @@ -08JUL2008 version 0.54 ----------------------- +bcm5974 (0.55) unstable; urgency=low -And another one... finally got the bright idea to test it by emulating -the different product ids. + * Package updates. + * Reverting GFP_ATOMIC for irq handlers. -07JUL2008 version 0.53 ----------------------- + -- Henrik Rydberg Wed, 09 Jul 2008 20:59:39 +0200 -Another typo in the post-install script. +bcm5974 (0.54) unstable; urgency=low -07JUL2008 version 0.52 ----------------------- + * And another one... finally got the bright idea to test it by + emulating the different product ids. -Typo in the post-install script. + -- Henrik Rydberg Tue, 08 Jul 2008 20:59:39 +0200 -07JUL2008 version 0.51 ----------------------- +bcm5974 (0.53) unstable; urgency=low -Fine-tuned signal-to-noise ratio, smoother mouse motion. -Interrupt code got minor simplifications. -GFP_ATOMIC completetly removed. + * Another typo in the post-install script. -06JUL2008 version 0.5 ----------------------- + -- Henrik Rydberg Mon, 07 Jul 2008 20:59:39 +0200 -Working palm detection, changes for kernel.org, dkms introduced. +bcm5974 (0.52) unstable; urgency=low -01JUL2008 version 0.42 ----------------------- + * Typo in the post-install script. -First button click registered, pre/post-reset added. + -- Henrik Rydberg Mon, 07 Jul 2008 20:09:39 +0200 -29JUN2008 version 0.41 ----------------------- +bcm5974 (0.51) unstable; urgency=low -The reset_resume kernel function added. + * Fine-tuned signal-to-noise ratio, smoother mouse motion. + * Interrupt code got minor simplifications. + * GFP_ATOMIC completetly removed. -29JUN2008 version 0.4 ----------------------- + -- Henrik Rydberg Mon, 07 Jul 2008 18:09:39 +0200 -Both finger pressure and width reported. +bcm5974 (0.5) unstable; urgency=low -27JUN2008 version 0.31 ----------------------- + * Working palm detection + * Changes for kernel.org + * DKMS introduced. -Administrative changes for kernel.org. + -- Henrik Rydberg Sun, 06 Jul 2008 20:59:39 +0200 -27JUN2008 version 0.3 ----------------------- +bcm5974 (0.42) unstable; urgency=low -Explicit device structure, use all packages. + * First button click registered. + * Hooks pre/post-reset added. -27JUN2008 version 0.23 ----------------------- + -- Henrik Rydberg Tue, 01 Jul 2008 20:59:39 +0200 -Finger release not reported properly. +bcm5974 (0.41) unstable; urgency=low -26JUN2008 version 0.22 ----------------------- + * The reset_resume kernel function added. -ABS coordinates more stable with synaptics. + -- Henrik Rydberg Sun, 29 Jun 2008 20:59:39 +0200 + +bcm5974 (0.4) unstable; urgency=low -25JUN2008 version 0.21 ----------------------- + * Both finger pressure and width reported. -Fixed the relative coordinate scaling. + -- Henrik Rydberg Sun, 29 Jun 2008 18:59:39 +0200 -25JUN2008 version 0.2 ----------------------- +bcm5974 (0.31) unstable; urgency=low -Misinterpreted pressure input, noise reduction. + * Administrative changes for kernel.org. -24JUN2008 version 0.1 ----------------------- + -- Henrik Rydberg Fri, 27 Jun 2008 20:59:39 +0200 -First version. +bcm5974 (0.3) unstable; urgency=low + * Explicit device structure, use all packages. + + -- Henrik Rydberg Fri, 27 Jun 2008 18:59:39 +0200 + +bcm5974 (0.23) unstable; urgency=low + + * Finger release not reported properly. + + -- Henrik Rydberg Fri, 27 Jun 2008 17:59:39 +0200 + +bcm5974 (0.22) unstable; urgency=low + + * ABS coordinates more stable with synaptics. + + -- Henrik Rydberg Thu, 26 Jun 2008 20:59:39 +0200 + +bcm5974 (0.21) unstable; urgency=low + + * Fixed the relative coordinate scaling. + + -- Henrik Rydberg Wed, 25 Jun 2008 20:59:39 +0200 + +bcm5974 (0.2) unstable; urgency=low + + * Misinterpreted pressure input, noise reduction. + + -- Henrik Rydberg Wed, 25 Jun 2008 20:59:39 +0200 + +bcm5974 (0.1) unstable; urgency=low + + * First version. + + -- Henrik Rydberg Tue, 24 Jun 2008 20:59:39 +0200 diff --git a/INSTALL b/INSTALL index 7c7e975..2a2c42f 100644 --- a/INSTALL +++ b/INSTALL @@ -9,7 +9,7 @@ Standing in the source directory, do: 3. sudo ./scripts/bcm5974-post-install -4. reboot (only if bcm5974 never was used before) +4. reboot (or reload the bcm5974 module if already installed) For trouble-shooting, try running diff --git a/bcm5974-dkms-mkdeb/debian/README.Debian b/bcm5974-dkms-mkdeb/debian/README.Debian index 7a1b108..1f170f1 100644 --- a/bcm5974-dkms-mkdeb/debian/README.Debian +++ b/bcm5974-dkms-mkdeb/debian/README.Debian @@ -1,10 +1,23 @@ MODULE_NAME DKMS module for Debian -This driver adds support for the multitouch trackpad on the new -Apple Macbook Air and Macbook Pro Penryn laptops. It replaces the +BCM5974: This driver adds support for the multitouch trackpad on the +new Apple Macbook Air and Macbook Pro Penryn laptops. It replaces the appletouch driver on those computers, and integrates well with the -synaptics driver of the Xorg system. +synaptics driver of the Xorg system. -This package was automatically generated by the DKMS system, -for distribution on Debian based operating systems. +Known to work on Macbook Air and Macbook Pro Penryn. +* Install the debian package (uses dkms) + +* Reboot + +Post installation + +* Make sure your /etc/X11/xorg.conf settings are sane. + +* If experiencing problems with your xorg settings, try the + bcm5974-diagnostics script (dkms installs the source under /usr/src/). + +Enjoy! + +Henrik Rydberg diff --git a/bcm5974-dkms-mkdeb/debian/changelog b/bcm5974-dkms-mkdeb/debian/changelog index 029a7bc..1d4e435 100644 --- a/bcm5974-dkms-mkdeb/debian/changelog +++ b/bcm5974-dkms-mkdeb/debian/changelog @@ -1,6 +1,6 @@ MODULE_NAME-dkms (MODULE_VERSION) unstable; urgency=low - * Automatically packaged by DKMS. + * Package updates. + * Reverting GFP_ATOMIC for irq handlers. -- Henrik Rydberg DATE_STAMP - diff --git a/bcm5974-dkms-mkdeb/debian/control b/bcm5974-dkms-mkdeb/debian/control index ad717e6..c5497bf 100644 --- a/bcm5974-dkms-mkdeb/debian/control +++ b/bcm5974-dkms-mkdeb/debian/control @@ -4,8 +4,13 @@ Priority: optional Maintainer: Henrik Rydberg Build-Depends: debhelper (>= 5) Standards-Version: 3.7.2 +Homepage: http://web.comhem.se/rydberg/Bits/ Package: MODULE_NAME-dkms Architecture: all Depends: dkms (>= 1.95), bash (>> 1.99) Description: Apple USB BCM5974 Multitouch trackpad support (DKMS) + This driver adds support for the multitouch trackpad on the new + Apple Macbook Air and Macbook Pro Penryn laptops. It replaces the + appletouch driver on those computers, and integrates well with the + synaptics driver of the Xorg system. diff --git a/bcm5974-dkms-mkdeb/debian/copyright b/bcm5974-dkms-mkdeb/debian/copyright index d690e83..e00b447 100644 --- a/bcm5974-dkms-mkdeb/debian/copyright +++ b/bcm5974-dkms-mkdeb/debian/copyright @@ -1,4 +1,41 @@ -GNU GENERAL PUBLIC LICENSE Version 2 +The bcm5974-dkms package was created using DKMS -See the LICENSE file of this distribution for details. +Source URL: http://web.comhem.se/rydberg/Bits/ +Upstream Author: Henrik Rydberg + +Copyright: + Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) + + The USB initialization and package decoding was made by + Scott Shawcroft as part of the touchd user-space driver project: + Copyright (C) 2008 Scott Shawcroft (scott.shawcroft@gmail.com) + + The BCM5974 driver is based on the appletouch driver: + Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) + Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) + Copyright (C) 2005 Stelian Pop (stelian@popies.net) + Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) + Copyright (C) 2005 Peter Osterlund (petero2@telia.com) + Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) + Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Packaging: + Copyright (C) 2008 by Henrik Rydberg + released under GPL 2 diff --git a/bcm5974-dkms-mkdeb/debian/dirs b/bcm5974-dkms-mkdeb/debian/dirs index 2b01d9a..b601f22 100644 --- a/bcm5974-dkms-mkdeb/debian/dirs +++ b/bcm5974-dkms-mkdeb/debian/dirs @@ -1,2 +1 @@ usr/src -etc/modprobe.d diff --git a/bcm5974.c b/bcm5974.c index 4d9dd45..2b94835 100644 --- a/bcm5974.c +++ b/bcm5974.c @@ -167,7 +167,7 @@ struct atp { #define DIM_Y 800 /* maximum trackpad y value */ /* logical signal quality */ -#define SN_PRESSURE 40 /* pressure signal-to-noise ratio */ +#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */ #define SN_WIDTH 100 /* width signal-to-noise ratio */ #define SN_COORD 250 /* coordinate signal-to-noise ratio */ @@ -385,7 +385,7 @@ static void irq_button(struct urb *urb) input_sync(dev->input); exit: - error = usb_submit_urb(dev->bt_urb, GFP_KERNEL); + error = usb_submit_urb(dev->bt_urb, GFP_ATOMIC); if (error) err("bcm5974: button urb failed: %d", error); } @@ -424,7 +424,7 @@ static void irq_trackpad(struct urb *urb) input_sync(dev->input); exit: - error = usb_submit_urb(dev->tp_urb, GFP_KERNEL); + error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC); if (error) err("bcm5974: trackpad urb failed: %d", error); } diff --git a/dkms.conf b/dkms.conf index cb169d6..44076e7 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,8 +1,9 @@ PACKAGE_NAME="bcm5974" -PACKAGE_VERSION="0.54" +PACKAGE_VERSION="0.55" MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" BUILT_MODULE_NAME[0]="bcm5974" DEST_MODULE_LOCATION[0]="/kernel/drivers/input/mouse" +PRE_INSTALL="scripts/bcm5974-pre-install" POST_INSTALL="scripts/bcm5974-post-install" POST_REMOVE="scripts/bcm5974-post-remove" diff --git a/scripts/bcm5974-pre-install b/scripts/bcm5974-pre-install new file mode 100755 index 0000000..3c4556e --- /dev/null +++ b/scripts/bcm5974-pre-install @@ -0,0 +1,43 @@ +#!/bin/bash +# +# bcm5943-pre-install - check system before installing the bcm5974 +# +# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +DRIVER=bcm5974 +LSUSB=/usr/sbin/lsusb + +PAT[0]="05ac:022" +PAT[1]="05ac:023" + +#if [ -x $LSUSB ]; then +if true; then + if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then + exit 0 + elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then + exit 0 + else + echo bcm5974: no suitable device found + exit 1 + fi +else + echo bcm5974: cannot determine device type + exit 1 +fi + +exit 0 -- cgit v1.2.3 From 5bf3dece8af80656f0ab23421c720451e4157ad2 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Wed, 8 Oct 2008 23:26:39 +0200 Subject: bcm5974 (0.56) unstable; urgency=low * Leave device initialization to hid; use mode-switch only * Mode switch moved to atp_open and simplified * Corrected cleanup action in atp_open * Simplified control package detection * Removed reset_resume, pre_reset, post_reset; not needed -- Henrik Rydberg Fri, 18 Jul 2008 02:42:52 +0200 --- CHANGES | 10 +++++ Makefile | 2 +- bcm5974-dkms-mkdeb/debian/changelog | 7 +++- bcm5974.c | 75 ++++++------------------------------- dkms.conf | 2 +- scripts/bcm5974-diagnostics | 9 ----- scripts/bcm5974-pre-install | 7 ++-- 7 files changed, 32 insertions(+), 80 deletions(-) (limited to 'scripts') diff --git a/CHANGES b/CHANGES index 6e51394..d31ea79 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +bcm5974 (0.56) unstable; urgency=low + + * Leave device initialization to hid; use mode-switch only + * Mode switch moved to atp_open and simplified + * Corrected cleanup action in atp_open + * Simplified control package detection + * Removed reset_resume, pre_reset, post_reset; not needed + + -- Henrik Rydberg Fri, 18 Jul 2008 02:42:52 +0200 + bcm5974 (0.55) unstable; urgency=low * Package updates. diff --git a/Makefile b/Makefile index 74335c8..6a04556 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Makefile for USB Network drivers +# Makefile for input/mouse drivers # 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 @@ MODULE_NAME-dkms (MODULE_VERSION) unstable; urgency=low - * Package updates. - * Reverting GFP_ATOMIC for irq handlers. + * Leave device initialization to hid; use mode-switch only + * Mode switch moved to atp_open and simplified + * Corrected cleanup action in atp_open + * Simplified control package detection + * Removed reset_resume, pre_reset, post_reset; not needed -- Henrik Rydberg DATE_STAMP diff --git a/bcm5974.c b/bcm5974.c index 2b94835..67cbab3 100644 --- a/bcm5974.c +++ b/bcm5974.c @@ -157,7 +157,6 @@ struct atp { struct bt_data *bt_data; /* button transferred data */ struct urb *tp_urb; /* trackpad usb request block */ struct tp_data *tp_data; /* trackpad transferred data */ - unsigned tp_valid; /* trackpad sensors valid */ }; /* logical dimensions */ @@ -283,10 +282,9 @@ static int report_tp_state(struct atp *dev, int size) #define ATP_WELLSPRING_MODE_WRITE_REQUEST_ID 9 #define ATP_WELLSPRING_MODE_REQUEST_VALUE 0x300 #define ATP_WELLSPRING_MODE_REQUEST_INDEX 0 -#define ATP_WELLSPRING_MODE_VENDOR_VALUE_1 0x01 -#define ATP_WELLSPRING_MODE_VENDOR_VALUE_2 0x05 +#define ATP_WELLSPRING_MODE_VENDOR_VALUE 0x01 -static int atp_wellspring_init(struct atp *dev) +static int atp_wellspring_mode(struct atp *dev) { char *data = kmalloc(8, GFP_KERNEL); int error = 0, size; @@ -297,24 +295,6 @@ static int atp_wellspring_init(struct atp *dev) goto error; } - /* reset button endpoint */ - if (usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), - USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, - 0, dev->cfg.bt_ep, NULL, 0, 5000)) { - err("bcm5974: could not reset button endpoint"); - error = -EIO; - goto error; - } - - /* reset trackpad endpoint */ - if (usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), - USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, - 0, dev->cfg.tp_ep, NULL, 0, 5000)) { - err("bcm5974: could not reset trackpad endpoint"); - error = -EIO; - goto error; - } - /* read configuration */ size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), ATP_WELLSPRING_MODE_READ_REQUEST_ID, @@ -329,8 +309,7 @@ static int atp_wellspring_init(struct atp *dev) } /* apply the mode switch */ - data[0] = ATP_WELLSPRING_MODE_VENDOR_VALUE_1; - data[1] = ATP_WELLSPRING_MODE_VENDOR_VALUE_2; + data[0] = ATP_WELLSPRING_MODE_VENDOR_VALUE; /* write configuration */ size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), @@ -345,9 +324,7 @@ static int atp_wellspring_init(struct atp *dev) goto error; } - dev->tp_valid = 0; - - printk(KERN_INFO "bcm5974: Wellspring mode initialized.\n"); + dprintk(2, "bcm5974: switched to wellspring mode.\n"); kfree(data); return 0; @@ -409,11 +386,9 @@ static void irq_trackpad(struct urb *urb) goto exit; } - /* first sample data ignored */ - if (!dev->tp_valid) { - dev->tp_valid = 1; + /* control response ignored */ + if (dev->tp_urb->actual_length == 2) goto exit; - } if (report_tp_state(dev, dev->tp_urb->actual_length)) { dprintk(1, "bcm5974: bad trackpad package, length: %d\n", @@ -434,18 +409,21 @@ static int atp_open(struct input_dev *input) struct atp *dev = input_get_drvdata(input); if (!dev->open) { + if (atp_wellspring_mode(dev)) + printk(KERN_INFO "bcm5974: mode switch failed\n"); + if (usb_submit_urb(dev->bt_urb, GFP_KERNEL)) goto error; if (usb_submit_urb(dev->tp_urb, GFP_KERNEL)) - goto err_free_bt_urb; + goto err_kill_bt; } dev->open = 1; dev->suspended = 0; return 0; -err_free_bt_urb: - usb_free_urb(dev->bt_urb); +err_kill_bt: + usb_kill_urb(dev->bt_urb); error: return -EIO; } @@ -486,12 +464,6 @@ static int atp_probe(struct usb_interface *iface, dev->input = input_dev; dev->cfg = *cfg; - /* switch to raw sensor mode */ - if (atp_wellspring_init(dev)) { - error = -EIO; - goto err_free_devs; - } - dev->bt_urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->bt_urb) { error = -ENOMEM; @@ -631,35 +603,12 @@ static int atp_resume(struct usb_interface *iface) return error; } -static int atp_reset_resume(struct usb_interface *iface) -{ - struct atp *dev = usb_get_intfdata(iface); - - if (dev && atp_wellspring_init(dev)) - printk(KERN_INFO "bcm5974: warning: reset failed\n"); - - return atp_resume(iface); -} - -static int atp_pre_reset(struct usb_interface *iface) -{ - return atp_suspend(iface, PMSG_ON); -} - -static int atp_post_reset(struct usb_interface *iface) -{ - return atp_reset_resume(iface); -} - static struct usb_driver atp_driver = { .name = "bcm5974", .probe = atp_probe, .disconnect = atp_disconnect, .suspend = atp_suspend, .resume = atp_resume, - .reset_resume = atp_reset_resume, - .pre_reset = atp_pre_reset, - .post_reset = atp_post_reset, .id_table = atp_table, }; diff --git a/dkms.conf b/dkms.conf index 44076e7..93e97f3 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="bcm5974" -PACKAGE_VERSION="0.55" +PACKAGE_VERSION="0.56" MAKE[0]="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" 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 echo \* $DEVPATH: does not exist, ignore fi -# Was the $DRIVER properly initialized? -WELLSPRING=`dmesg|grep $DRIVER|grep Wellspring` -if [ "$WELLSPRING" != "" ]; then - echo \* $DRIVER: Wellspring was initialized -else - echo \* $DRIVER: Wellspring was NOT initialized - exit 1 -fi - # Do we have synaptics working properly? typeset -i SYNLINES=`synclient -l|wc -l` 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 PAT[0]="05ac:022" PAT[1]="05ac:023" -#if [ -x $LSUSB ]; then -if true; then +if [ -x $LSUSB ]; then if [ "`$LSUSB|grep ${PAT[0]}`" != "" ]; then exit 0 elif [ "`$LSUSB|grep ${PAT[1]}`" != "" ]; then exit 0 else echo bcm5974: no suitable device found - exit 1 + exit -1 fi else echo bcm5974: cannot determine device type - exit 1 + exit -1 fi exit 0 -- cgit v1.2.3