From patchwork Wed Dec 16 02:59:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 68289 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ixk3005715 for ; Fri, 18 Dec 2009 04:45:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756230AbZLPC7l (ORCPT ); Tue, 15 Dec 2009 21:59:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756234AbZLPC7l (ORCPT ); Tue, 15 Dec 2009 21:59:41 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:54818 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756230AbZLPC7k (ORCPT ); Tue, 15 Dec 2009 21:59:40 -0500 Received: by pwj9 with SMTP id 9so346408pwj.21 for ; Tue, 15 Dec 2009 18:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ihQr3cK6Pt7iJUvH7tTPAnN4FosrADH3vBbtExJQH68=; b=dPvnFB8lPCTu9+4Lt/ErOCFZ2qlaAKc8td+JclVhkqIH31XNeCfxhkh9Bpb5l1n8GW 5PSKaOJvc8av7TbSdhEQQd5XaIaSnKRvAcq1uFQPd9ZUG8jm/7B6qJMzGMbFN3DBAkET dc16SXP/dB+X14IBUuLtvNBnG5G4xu1XUIedE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=oVXSXyUjnaxdE1b78sMlQUhpYstT3XmjrJjUGtYFuZK2r+DG+NEgSmIaD1rg1EbjXf 05jQp267Q8YITXIXYNdf3C1O7cDSqn3XFi39dNTAgQ3NZkwv74dV7kND+DYg4LDbWesF AyphTFT9q6gs57fuRVwTCNCpnTTN8tnfn83dw= Received: by 10.141.53.2 with SMTP id f2mr285834rvk.247.1260932379073; Tue, 15 Dec 2009 18:59:39 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 20sm329558pzk.1.2009.12.15.18.59.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Dec 2009 18:59:38 -0800 (PST) Date: Tue, 15 Dec 2009 18:59:34 -0800 From: Dmitry Torokhov To: Alex Chiang Cc: Takashi Iwai , linux-kernel , linux-input@vger.kernel.org Subject: Re: synaptics touchpad doesn't click Message-ID: <20091216025934.GA2699@core.coreip.homeip.net> References: <20091214014828.GA28402@ldl.fc.hp.com> <20091214173450.GB2373@core.coreip.homeip.net> <20091215034127.GC587@ldl.fc.hp.com> <20091215062628.GA12669@core.coreip.homeip.net> <20091215073358.GC12669@core.coreip.homeip.net> <20091215082518.GD12669@core.coreip.homeip.net> <20091216010506.GA26367@ldl.fc.hp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091216010506.GA26367@ldl.fc.hp.com> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 7047558..633b975 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -338,12 +338,16 @@ static void synaptics_parse_new_hw(unsigned char buf[], ((buf[0] & 0x04) >> 1) | ((buf[3] & 0x04) >> 2); - hw->left = buf[0] & 0x01; - hw->right = buf[0] & 0x02; + if (SYN_CAP_CLICKPAD(priv->ext_cap)) { + hw->left = (buf[0] ^ buf[3]) & 0x01; + } else { + hw->left = buf[0] & 0x01; + hw->right = buf[0] & 0x02; - if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { - hw->middle = (buf[0] ^ buf[3]) & 0x01; - hw->scroll = hw->w == 2 ? (signed char)buf[1] : 0; + if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { + hw->middle = (buf[0] ^ buf[3]) & 0x01; + hw->scroll = hw->w == 2 ? (signed char)buf[1] : 0; + } } if (SYN_CAP_FOUR_BUTTON(priv->capabilities)) { @@ -592,6 +596,13 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) __clear_bit(REL_X, dev->relbit); __clear_bit(REL_Y, dev->relbit); + /* + * ClickPads are buttonless devices. We report the touchpad clicks + * as BTN_LEFT but there is no BTN_RIGHT or BTN_MIDDLE. + */ + if (SYN_CAP_CLICKPAD(priv->ext_cap)) + __clear_bit(BTN_RIGHT, dev->keybit); + dev->absres[ABS_X] = priv->x_res; dev->absres[ABS_Y] = priv->y_res; } diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 838e7f2..343dfc0 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@ -48,6 +48,8 @@ #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) +#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) +#define SYN_CAP_CLICKPAD(ec) (SYN_CAP_PRODUCT_ID(ec) == 0xe4) /* synaptics modes query bits */ #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))