From patchwork Sun Jan 3 14:56:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 70504 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 o03F1kdS032476 for ; Sun, 3 Jan 2010 15:01:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750977Ab0ACPBm (ORCPT ); Sun, 3 Jan 2010 10:01:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751385Ab0ACPBm (ORCPT ); Sun, 3 Jan 2010 10:01:42 -0500 Received: from queueout01-winn.ispmail.ntl.com ([81.103.221.31]:54129 "EHLO queueout01-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977Ab0ACPBm (ORCPT ); Sun, 3 Jan 2010 10:01:42 -0500 X-Greylist: delayed 302 seconds by postgrey-1.27 at vger.kernel.org; Sun, 03 Jan 2010 10:01:41 EST Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20100103145637.YOIY17029.mtaout01-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com>; Sun, 3 Jan 2010 14:56:37 +0000 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout02-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20100103145637.MUWX21638.aamtaout02-winn.ispmail.ntl.com@zog.reactivated.net>; Sun, 3 Jan 2010 14:56:37 +0000 Received: by zog.reactivated.net (Postfix, from userid 1000) id E2E9C9D400D; Sun, 3 Jan 2010 14:56:33 +0000 (GMT) From: Daniel Drake To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org Cc: akpm@linux-foundation.org Subject: [PATCH resend] Input: psmouse - Fix a synaptics protocol detection mistake Message-Id: <20100103145633.E2E9C9D400D@zog.reactivated.net> Date: Sun, 3 Jan 2010 14:56:33 +0000 (GMT) X-Cloudmark-Analysis: v=1.1 cv=ZtHxNT4mZm3rCuM0SmWmgWxeBwJsziC8EqOrwwVkrhA= c=1 sm=0 a=Vfl3ZYvSZYUA:10 a=Op-mwl0xAAAA:8 a=N_4Dbyg9kxA12c9u7gwA:9 a=ogm07pNOLUALGHb3QGsA:7 a=8UpZykOvGPybCmKPb7EwxqZAsw4A:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 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 401ac6b..613a55a 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -627,8 +627,12 @@ static int psmouse_extensions(struct psmouse *psmouse, synaptics_hardware = true; 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 05689e7..b4d38f5 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -743,6 +743,11 @@ int synaptics_init(struct psmouse *psmouse) return -1; } +int synaptics_supported(void) +{ + return 1; +} + #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ void __init synaptics_module_init(void) @@ -754,5 +759,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 838e7f2..d53ffe6 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h @@ -109,5 +109,6 @@ void synaptics_module_init(void); int synaptics_detect(struct psmouse *psmouse, bool set_properties); int synaptics_init(struct psmouse *psmouse); void synaptics_reset(struct psmouse *psmouse); +int synaptics_supported(void); #endif /* _SYNAPTICS_H */