From patchwork Thu Nov 19 10:05:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 61267 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAJA5rPF025643 for ; Thu, 19 Nov 2009 10:05:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753055AbZKSKFq (ORCPT ); Thu, 19 Nov 2009 05:05:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754246AbZKSKFq (ORCPT ); Thu, 19 Nov 2009 05:05:46 -0500 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:32652 "EHLO mtaout03-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbZKSKFp (ORCPT ); Thu, 19 Nov 2009 05:05:45 -0500 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20091119100551.NWVO17277.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Thu, 19 Nov 2009 10:05:51 +0000 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20091119100551.ZPHG13254.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Thu, 19 Nov 2009 10:05:51 +0000 Received: by zog.reactivated.net (Postfix, from userid 1000) id D29239D404F; Thu, 19 Nov 2009 10:05:48 +0000 (GMT) From: Daniel Drake To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org Cc: devel@lists.laptop.org Subject: [PATCH] Input: psmouse - Fix a synaptics protocol detection mistake Message-Id: <20091119100548.D29239D404F@zog.reactivated.net> Date: Thu, 19 Nov 2009 10:05:48 +0000 (GMT) X-Cloudmark-Analysis: v=1.0 c=1 a=5yBqICatpW8A:10 a=Op-mwl0xAAAA:8 a=N_4Dbyg9kxA12c9u7gwA:9 a=XvJb08lst0B7K6vFyk0A:7 a=VvZkcwGefyLsN_JsjpOAkmfbTFEA:4 a=d4CUUju0HPYA:10 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/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index b407b35..85f052a 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -610,8 +610,12 @@ static int psmouse_extensions(struct psmouse *psmouse, synaptics_hardware = 1; if (max_proto > PSMOUSE_IMEX) { - if (!set_properties || synaptics_init(psmouse) == 0) + /* be careful to only offer the synaptics protocol for use when + * the support is available */ + if (synaptics_supported() && + (!set_properties || synaptics_init(psmouse) == 0)) return PSMOUSE_SYNAPTICS; + /* * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). * Unfortunately Logitech/Genius probes confuse some firmware versions so diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index c65e245..e0ed951 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -738,6 +738,11 @@ int synaptics_init(struct psmouse *psmouse) return -1; } +int synaptics_supported(void) +{ + return 1; +} + #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ int synaptics_init(struct psmouse *psmouse) @@ -745,5 +750,10 @@ int synaptics_init(struct psmouse *psmouse) return -ENOSYS; } +int synaptics_supported(void) +{ + return 0; +} + #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 3023821..f85e644 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@ -108,5 +108,6 @@ struct synaptics_data { int synaptics_detect(struct psmouse *psmouse, int set_properties); int synaptics_init(struct psmouse *psmouse); void synaptics_reset(struct psmouse *psmouse); +int synaptics_supported(void); #endif /* _SYNAPTICS_H */