From owner-freebsd-current@FreeBSD.ORG Wed Jan 29 10:52:32 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA07417A; Wed, 29 Jan 2014 10:52:32 +0000 (UTC) Received: from mta05.bitpro.no (mta05.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 76B9F1A1E; Wed, 29 Jan 2014 10:52:32 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta05.bitpro.no (Postfix) with ESMTPS id 1ADC217FC93; Wed, 29 Jan 2014 11:52:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 7DFD28EE1ED; Wed, 29 Jan 2014 11:53:15 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sKxe8F27VOno; Wed, 29 Jan 2014 11:53:14 +0100 (CET) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id 1DD818EDF88; Wed, 29 Jan 2014 11:53:14 +0100 (CET) Message-ID: <52E8DDA3.3070301@bitfrost.no> Date: Wed, 29 Jan 2014 11:53:23 +0100 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: "Lundberg, Johannes" , Adrian Chadd Subject: Re: Apple Trackpad driver References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------050509010807080800010305" Cc: =?UTF-8?B?6buE5paH6L6J?= , freebsd-current , "freebsd-usb@freebsd.org" , "kwm@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jan 2014 10:52:33 -0000 This is a multi-part message in MIME format. --------------050509010807080800010305 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/29/14 09:49, Lundberg, Johannes wrote: > Hi > > I tested the driver on a 2012 Macbook Air 11" and it works great! Good job! > > Is there a way to disable click-by-touch? I always preferred clicking with > the physical button that is built in to the pad. > Hi, I've added an "#if 0" around the 1 finger tap code until further. Maybe this feature can be tunable? I fixed the code style, added some range checks and cleared some buffer issues. When you assign a signed value to an unsigned variable, you should range check it, because the sign might cause an overflow when you use it later on. int8_t x = -1; uint32_t t = x; "t" is now "0xffffffffU" and not "255". Tested the code on my MacBookPro. Hope I didn't break anything. If so, send a patch to freebsd-usb. http://svnweb.freebsd.org/changeset/base/261260 To get the touchpad working with Xorg, I needed to re-compile HALD with the attached patch. kwm: Can you get the attached patch into ports? Auto-loading of wsp via devd will be done later. Simply need to re-generate usb.conf in /etc ... --HPS --------------050509010807080800010305 Content-Type: text/x-diff; name="patch-hald_freebsd_hf-usb2.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-hald_freebsd_hf-usb2.c.diff" --- patch-hald_freebsd_hf-usb2.c.orig 2014-01-29 11:50:11.000000000 +0100 +++ patch-hald_freebsd_hf-usb2.c 2014-01-29 11:50:36.000000000 +0100 @@ -61,7 +61,7 @@ + if (driver) { + if (!strcmp(driver, "ukbd")) + hf_device_set_input(device, "keyboard", "keys", NULL); -+ else if (!strcmp(driver, "ums") || !strcmp(driver, "atp")) { ++ else if (!strcmp(driver, "ums") || !strcmp(driver, "atp") || !strcmp(driver, "wsp")) { + hf_device_set_input(device, "mouse", NULL, devname); + hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL); + } else if (!strcmp(driver, "uhid")) { --------------050509010807080800010305--