summaryrefslogtreecommitdiff
path: root/bcm5974-diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'bcm5974-diagnostics')
-rwxr-xr-xbcm5974-diagnostics203
1 files changed, 203 insertions, 0 deletions
diff --git a/bcm5974-diagnostics b/bcm5974-diagnostics
new file mode 100755
index 0000000..fa6a4ef
--- /dev/null
+++ b/bcm5974-diagnostics
@@ -0,0 +1,203 @@
1#!/bin/bash
2#
3# bcm5943-diagnostics - troubleshooting the BCM5974 setup
4#
5# Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20#
21
22DRIVER=bcm5974
23
24echo -----------------------------------------------------------------------
25
26# What kernel version am I running?
27KERNEL=`uname -r`
28echo \* Kernel version: $KERNEL
29
30# What synaptics version is installed (debian)?
31if [ -x /usr/bin/dpkg-query ]; then
32 SYNAPTICS=`/usr/bin/dpkg-query -W -f='${Version}\n' xserver-xorg-input-synaptics`
33 echo \* Synaptics version: $SYNAPTICS
34else
35 echo \* Synaptics version: UNKNOWN - dpkg not found
36fi
37
38# What USB devices of interest can we find?
39if [ -x /usr/sbin/lsusb ]; then
40 LSUSB=`lsusb|grep -c 05ac:022`
41 echo \* USB device: $LSUSB
42else
43 echo \* USB device: UNKNOWN - lsusb not found
44fi
45
46# Do we have the module intalled?
47MODLIB=/lib/modules/$KERNEL/kernel/drivers/input/mouse/$DRIVER.ko
48if [ -f $MODLIB ]; then
49 echo \* $MODLIB: exists
50else
51 echo \* $MODLIB: does NOT exist
52 echo Copy the file $DRIVER.ko to $MODLIB
53 exit 1
54fi
55
56# Do we have the module configured?
57MODULES=/etc/modules
58if [ -f $MODULES ]; then
59 if (grep -q $DRIVER $MODULES); then
60 echo \* $MODULES: has $DRIVER
61 else
62 echo \* $MODULES: does NOT have $DRIVER
63 echo Add this line to $MODULES:
64 echo $DRIVER
65 exit 1
66 fi
67else
68 echo \* $MODULES: file not found
69 exit 1
70fi
71
72# Do we have the right quirks?
73MODPROBE=/etc/modprobe.d/options
74if [ -f $MODPROBE ]; then
75 MODPROBEOPTS=`grep quirks= $MODPROBE|grep -v ^#|grep 0x05ac:0x02`
76 if [ "$MODPROBEOPTS" != "" ]; then
77 echo \* $MODPROBE: has quirks
78 else
79 echo \* $MODPROBE: does NOT have quirks
80 echo Add this line to $MODPROBE:
81 echo -n options usbhid quirks=
82 (lsusb|grep -q 05ac:022) && echo 0x05ac:0x0223:0x00020800,0x05ac:0x0224:0x00024800,0x05ac:0x0225:0x00020800
83 (lsusb|grep -q 05ac:023) && echo 0x05ac:0x0230:0x00020800,0x05ac:0x0231:0x00024800,0x05ac:0x0232:0x00020800
84 exit 1
85 fi
86else
87 echo \* $MODPROBE: file not found
88 exit 1
89fi
90
91# Was the $DRIVER module loaded?
92DMESG=`lsmod|grep $DRIVER`
93if [ "$DMESG" != "" ]; then
94 echo \* $DRIVER: module is loaded
95else
96 echo \* $DRIVER: module is NOT loaded
97 echo Add this line to /etc/modules:
98 echo "$DRIVER"
99 exit 1
100fi
101
102# Was the $DRIVER properly initialized?
103WELLSPRING=`dmesg|grep $DRIVER|grep Wellspring`
104if [ "$WELLSPRING" != "" ]; then
105 echo \* $DRIVER: Wellspring was initialized
106else
107 echo \* $DRIVER: Wellspring was NOT initialized
108 exit 1
109fi
110
111# Do we have synaptics working properly?
112typeset -i SYNLINES=`synclient -l|wc -l`
113if [ $SYNLINES -gt 10 ]; then
114 echo \* synaptics: configuration readable
115else
116 echo \* synaptics: configuration NOT readable
117 exit 1
118fi
119
120# Do we have a working synaptics configuration?
121DIFF=/tmp/synclient-output.diff.$$
122TMP=/tmp/synclient-output.txt.$$
123synclient -l | sort > $TMP
124diff -u - $TMP > $DIFF <<EOF
125 AccelFactor = 0.1
126 BottomEdge = 800
127 CircScrollDelta = 0.1
128 CircScrollTrigger = 0
129 CircularPad = 0
130 CircularScrolling = 0
131 ClickTime = 100
132 CoastingSpeed = 0
133 CornerCoasting = 0
134 EdgeMotionMaxSpeed = 80
135 EdgeMotionMaxZ = 160
136 EdgeMotionMinSpeed = 1
137 EdgeMotionMinZ = 30
138 EdgeMotionUseAlways = 0
139 EmulateMidButtonTime = 75
140 EmulateTwoFingerMinZ = 257
141 FastTaps = 0
142 FingerHigh = 23
143 FingerLow = 16
144 FingerPress = 256
145 GrabEventDevice = 1
146 GuestMouseOff = 0
147 HorizEdgeScroll = 0
148 HorizScrollDelta = 0
149 HorizTwoFingerScroll = 1
150 LBCornerButton = 0
151 LeftEdge = 0
152 LeftRightScrolling = 1
153 LeftRightScrollRepeat = 1
154 LockedDrags = 0
155 LockedDragTimeout = 5000
156 LTCornerButton = 0
157 MaxDoubleTapTime = 200
158 MaxSpeed = 1.2
159 MaxTapMove = 100
160 MaxTapTime = 223
161 MinSpeed = 0.8
162 MultiFingerButton = 2
163 PalmDetect = 0
164 PalmMinWidth = 180
165 PalmMinZ = 10
166Parameter settings:
167 PressureMotionMaxFactor = 1
168 PressureMotionMaxZ = 160
169 PressureMotionMinFactor = 1
170 PressureMotionMinZ = 10
171 RBCornerButton = 0
172 RightEdge = 1280
173 RTCornerButton = 0
174 ScrollButtonRepeat = 100
175 SingleTapTimeout = 180
176 TapButton1 = 0
177 TapButton2 = 0
178 TapButton3 = 0
179 TopEdge = 0
180 TouchpadOff = 0
181 TrackstickSpeed = 40
182 UpDownScrolling = 1
183 UpDownScrollRepeat = 1
184 VertEdgeScroll = 0
185 VertScrollDelta = 40
186 VertTwoFingerScroll = 1
187EOF
188rm -f $TMP
189
190echo =======================================================================
191echo The bcm5974 seems properly configured
192
193typeset -i NDIFF=`cat $DIFF|wc -l`
194if [ $NDIFF -gt 0 ]; then
195 echo
196 echo Your synaptics settings differ from the bcm5974 default:
197 echo -----------------------------------------------------------------------
198 tail -n +4 $DIFF
199 echo -----------------------------------------------------------------------
200 echo If in doubt, please check your /etc/X11/xorg.conf settings
201fi
202
203rm -f $DIFF