Macbook Pro 13.3" (5,5) Fedora 12 notes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Folks,

In case this helps anyone else setting up a Macbook Pro 13.3 model 5,5.

1). Installation proceeds normally. You may want to install rEFIt to
allow dual booting with Mac OS X, in which case Anaconda should oblige
by placing grub on the partition of your /boot partition. You then only
need to run gptsync by choosing the Partitioning Tool next boot.

I took my new Macbook apart and upgraded the disk to a 500GB model from
the tiny one it came with. They wanted a small fortune for a non 7200K
drive upgrade, so I laughed. My partitions are as follows:

1: EFI (hidden in OSX)
2: OSX (100GB)
3: Linux Boot (1GB)
4: Linux LVM (swap,root,100GB)
5: Shared (hfsplus,100GB)
6: Data (2ext4,200GB)

The first three partitions are mapped to the MBR style GRUB is looking
for following a gptsync within the EFI booter tool.

2). The new install has no networking because the 432b reversion part is
unsupported by the b43 Open Source driver (they are working on it). You
will need to download the "wl" driver from Broadcom. It won't load out
of the box because it can't see the device. For the moment, the
following hack in /usr/local/bin/wl_hack.sh (called from /etc/rc.local)
suffices to load (this is weird, seems the second load/unload results in
some ACPI power state change and the device will then show up randomly):

#!/bin/sh

# for some reason we don't see the bcm part unless we unload/reload
b43/wl.

modprobe b43
modprobe -r b43
modprobe wl
modprobe -r wl
modprobe b43
modprobe -r b43
modprobe wl

It may still drop off the network from time to time. An upstream driver
will be really helpful when that is available. I will need a backport of
a future stable wireless tree to 2.6.32 since I am not planning to
upgrade my X drivers for the incompatible ABI in future nouveau.

3). Sound won't work out of the box, but it will (including the
headphone detection) if you do the following:

rpm -e alsa-plugins-pulseaudio

Then alsamixer will show all of the channel options, which you should
set to 100% volume for now. The GNOME volume controls will now work. Add
"alsa-plugins-pulseaudio" to and exclude line /etc/yum.conf to prevent
it ever getting installed again. Also add "kernel" to that line while
you're at it if you'll be fixing the mouse in the next step. I like to
build my own kernels for Fedora so I generally forbid it installing.

4). Out of the box, the mouse experience is horrible. You may want to
create an xorg.conf file (using Xorg -configure), but there is a better
way to configure the mouse on recent systems. Place the following
in /etc/hal/fdi/policy/20thirdparty/10-synaptics.fdi:

<?xml version="1.0" encoding="ISO-8859-1"?>

<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.touchpad">
        <!-- To add custom options for the touchpad, modify the examples
below
             to suit your needs. The available options are listed in the
             "synaptics" man page. After modifyfing this file, you must
             restart HAL. Check the output of lshal whether your
modifications
             have been merged successfully.

             Note: Options must always be type "string".
             The following examples enable left, right, middle clicks on
             single, double, triple finger tapping, respectively.

             <merge key="input.x11_options.TapButton1"
type="string">1</merge>
             <merge key="input.x11_options.TapButton2"
type="string">3</merge>
             <merge key="input.x11_options.TapButton3"
type="string">2</merge>
        -->
	<merge key="input.x11_driver" type="string">synaptics</merge>
        <merge key="input.x11_options.SHMConfig"
type="string">On</merge>
        <merge key="input.x11_options.TapButton2"
type="string">0</merge>
        <merge key="input.x11_options.TapButton3"
type="string">0</merge>

	<!-- Not needed with the hacked up 2-finger-click-to-drag-driver
             <merge key="input.x11_options.ClickFinger2"
type="string">0</merge>
             <merge key="input.x11_options.ClickFinger3"
type="string">0</merge>
	-->
    </match>
  </device>
</deviceinfo>

That will turn off the most annoying "TapButton" options and tell X to
start the synaptics touchpad driver with the ability to dynamically tune
the driver using a shared memory mechanism. This enables "synclient".

You need a fixed bcm5974 mouse driver (with the attached patch - cleaned
up version to follow) that correctly supports two finger click-and-drag.
I have modified an existing patch for 2.6.32 kernels and will post a
kmod in due course. With that patch enabled you won't need to turn off
the ClickButton support and can both drag and right/middle click.

5). The gnome-power-manager gets a little confused sometimes. Make sure
it is always showing at least (sometimes it doesn't notice the battery
even though that is showing in lshal, etc.):

gconftool-2 -s -t string /apps/gnome-power-manager/ui/icon_policy always

You will also need to chvt or similar to/from another VT on resume in
order for the display to wake up. The HAL scripts specifically disable
quirks in the case of KMS because they believe it will always work. I
have tried hacking up the low level /usr/libexec/scripts/linux/ bits but
that isn't working, so I need to find out what I am missing. For the
moment, I switch to/from another VT on resume.

6). The backlit keyboard and controls aren't showing up or working. I
can live without these until I get chance to figure that out.

7). The webcam isn't working out of the box and nor is bluetooth. There
are instructions online covering these.

Once I configured my themes, set SELinux to permissive, and made a few
other personal taste quirks, the experience so far isn't too bad.

Jon.

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 0d1d334..5d5d2d0 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -96,6 +96,11 @@ static int debug = 1;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Activate debugging output");
 
+/* constants used to distinguish two-finger-clicking and click-and-drag
+ * on touchpads with integrated button */
+#define TWO_FINGERS_MAX_DIST_SQR (4500 * 4500)
+#define MIN_THUMB_WIDTH 1300
+
 /* button data structure */
 struct bt_data {
 	u8 unknown1;		/* constant */
@@ -317,9 +322,15 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 	const struct tp_finger *f;
 	struct input_dev *input = dev->input;
 	int raw_p, raw_w, raw_x, raw_y, raw_n;
+	int second_raw_w, second_raw_x, second_raw_y;
 	int ptest, origin, ibt = 0, nmin = 0, nmax = 0;
 	int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0;
 
+	/* state variables used to distinguish two-finger-clicking and
+ 	 * click-and-drag on touchpads with integrated button */
+	static bool click_started_with_two_fingers = false;
+	static int last_ibt = 0;
+
 	if (size < c->tp_offset || (size - c->tp_offset) % SIZEOF_FINGER != 0)
 		return -EIO;
 
@@ -329,11 +340,64 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 
 	/* always track the first finger; when detached, start over */
 	if (raw_n) {
-		raw_p = raw2int(f->force_major);
 		raw_w = raw2int(f->size_major);
 		raw_x = raw2int(f->abs_x);
 		raw_y = raw2int(f->abs_y);
 
+		/* only if we have an integrated button */
+		if (c->tp_type == TYPE2) {
+			if (raw_n == 2) {
+				/* Get second finger data */
+				second_raw_w = raw2int((f+1)->size_major);
+				second_raw_x = raw2int((f+1)->abs_x);
+				second_raw_y = raw2int((f+1)->abs_y);
+			}
+
+			/* set the integrated button */
+			ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
+
+			/* if just started clicking */
+			if (!last_ibt && ibt) {
+				if (raw_n == 2 &&
+					/* neither finger is likely to be the thumb
+					 * (i.e. neither is too wide) */
+					raw_w < MIN_THUMB_WIDTH &&
+					second_raw_w < MIN_THUMB_WIDTH &&
+					/* the two fingers are not too separated */
+					((second_raw_x - raw_x) *
+					 (second_raw_x - raw_x) +
+					 (second_raw_y - raw_y) *
+					 (second_raw_y - raw_y) < TWO_FINGERS_MAX_DIST_SQR))
+					click_started_with_two_fingers = true;
+			}
+			else if (!ibt && click_started_with_two_fingers)
+				click_started_with_two_fingers = false;
+
+			/* keep the last ibt value in static variable */
+			last_ibt = ibt;
+
+			/* if currently clicking and two fingers are touching the trackpad
+			   but initial clicking was not done with two fingers */
+			if (!click_started_with_two_fingers && ibt && raw_n == 2) {
+				/* if the second finger is the clicking one (i.e. is below),
+				 * ignore that finger and track the first finger */
+				if (second_raw_y < raw_y) {
+					raw_n--;
+				}
+				/* if the first finger is the clicking one (i.e. is below),
+				 * ignore that finger and track the second finger */
+				else {
+					f++;
+					raw_n--;
+					raw_w = second_raw_w;
+					raw_x = second_raw_x;
+					raw_y = second_raw_y;
+				}
+			}
+		}
+
+		raw_p = raw2int(f->force_major);
+
 		dprintk(9,
 			"bcm5974: "
 			"raw: p: %+05d w: %+05d x: %+05d y: %+05d n: %d\n",
@@ -342,10 +406,6 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 		ptest = int2bound(&c->p, raw_p);
 		origin = raw2int(f->origin);
 
-		/* set the integrated button if applicable */
-		if (c->tp_type == TYPE2)
-			ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
-
 		/* while tracking finger still valid, count all fingers */
 		if (ptest > PRESSURE_LOW && origin) {
 			abs_p = ptest;
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux