From: Andres Salomon <dilinger@queued.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, vojtech@suse.cz, warp@aehallh.com
Subject: Re: [PATCH] psmouse split [03/03]
Date: Wed, 03 Jan 2007 01:53:41 -0500 [thread overview]
Message-ID: <459B52F5.1000402@queued.net> (raw)
In-Reply-To: <459B5256.6050004@queued.net>
[-- Attachment #1: Type: text/plain, Size: 828 bytes --]
Andres Salomon wrote:
> Andres Salomon wrote:
>> Dmitry Torokhov wrote:
>>> On 12/13/06, Andres Salomon <dilinger@debian.org> wrote:
>>>> Alright, I guess we're down to a matter of taste then. I'll change the
>>>> patch to still have a monolithic psmouse that allows protocols to be
>>>> enabled/disabled via Kconfig.
>>>>
>>> That'd be great. Thanks!
>>>
>> Yikes, almost forgot to send this. Here you go; 3 patches total.
>> Please let me know if there are any other change. The first is attached.
^
Er, let me know if you'd like any other changes.
>>
>
> Here's the second; everything is split except for the synaptic stuff.
>
And finally, the third splits out the synaptic stuff.
My initial tests show that compiling the psmouse driver for a specific
protocol extension can cut the driver's size by more than half.
[-- Attachment #2: 0003-Allow-disabling-of-synaptic-protocol-extension.txt --]
[-- Type: text/plain, Size: 4875 bytes --]
>From ba82c3e427cd9e319e5d8898c2f730589da698a6 Mon Sep 17 00:00:00 2001
From: Andres Salomon <dilinger@debian.org>
Date: Tue, 26 Dec 2006 17:13:42 -0500
Subject: [PATCH] Allow disabling of synaptic protocol extension
This allows disabling of synaptic; basically, it leaves synaptic_detect()
and synaptic_reset() (for synaptic hardware emulating other protocols), but
gets rid of synaptic_init.
Signed-off-by: Andres Salomon <dilinger@debian.org>
---
drivers/input/mouse/Makefile | 6 +-----
drivers/input/mouse/psmouse-base.c | 5 +++++
drivers/input/mouse/synaptics.c | 34 ++++++++++++++++++++++------------
3 files changed, 28 insertions(+), 17 deletions(-)
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
index e7c7fbb..76722ec 100644
--- a/drivers/input/mouse/Makefile
+++ b/drivers/input/mouse/Makefile
@@ -14,7 +14,7 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o
obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o
obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
-psmouse-objs := psmouse-base.o
+psmouse-objs := psmouse-base.o synaptics.o
ifeq ($(CONFIG_MOUSE_PS2_ALPS),y)
psmouse-objs += alps.o
@@ -24,10 +24,6 @@ ifeq ($(CONFIG_MOUSE_PS2_LOGIPS2PP),y)
psmouse-objs += logips2pp.o
endif
-ifeq ($(CONFIG_MOUSE_PS2_SYNAPTICS),y)
-psmouse-objs += synaptics.o
-endif
-
ifeq ($(CONFIG_MOUSE_PS2_LIFEBOOK),y)
psmouse-objs += lifebook.o
endif
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 6b3ac9d..bfb47e1 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -583,8 +583,11 @@ #endif
synaptics_hardware = 1;
if (max_proto > PSMOUSE_IMEX) {
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
if (!set_properties || synaptics_init(psmouse) == 0)
return PSMOUSE_SYNAPTICS;
+#endif
+
/*
* Some Synaptics touchpads can emulate extended protocols (like IMPS/2).
* Unfortunately Logitech/Genius probes confuse some firmware versions so
@@ -702,6 +705,7 @@ #endif
.maxproto = 1,
.detect = im_explorer_detect,
},
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
{
.type = PSMOUSE_SYNAPTICS,
.name = "SynPS/2",
@@ -709,6 +713,7 @@ #endif
.detect = synaptics_detect,
.init = synaptics_init,
},
+#endif
#ifdef CONFIG_MOUSE_PS2_ALPS
{
.type = PSMOUSE_ALPS,
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 49ac696..5d69f52 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -45,28 +45,30 @@ #define YMAX_NOMINAL 4448
****************************************************************************/
/*
- * Send a command to the synpatics touchpad by special commands
+ * Set the synaptics touchpad mode byte by special commands
*/
-static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
+static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
{
- if (psmouse_sliced_command(psmouse, c))
+ unsigned char param[1];
+
+ if (psmouse_sliced_command(psmouse, mode))
return -1;
- if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO))
+ param[0] = SYN_PS_SET_MODE2;
+ if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_SETRATE))
return -1;
return 0;
}
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
+
/*
- * Set the synaptics touchpad mode byte by special commands
+ * Send a command to the synpatics touchpad by special commands
*/
-static int synaptics_mode_cmd(struct psmouse *psmouse, unsigned char mode)
+static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c, unsigned char *param)
{
- unsigned char param[1];
-
- if (psmouse_sliced_command(psmouse, mode))
+ if (psmouse_sliced_command(psmouse, c))
return -1;
- param[0] = SYN_PS_SET_MODE2;
- if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_SETRATE))
+ if (ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETINFO))
return -1;
return 0;
}
@@ -529,12 +531,16 @@ static void set_input_params(struct inpu
clear_bit(REL_Y, dev->relbit);
}
+#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
+
void synaptics_reset(struct psmouse *psmouse)
{
/* reset touchpad back to relative mode, gestures enabled */
synaptics_mode_cmd(psmouse, 0);
}
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
+
static void synaptics_disconnect(struct psmouse *psmouse)
{
synaptics_reset(psmouse);
@@ -569,6 +575,8 @@ static int synaptics_reconnect(struct ps
return 0;
}
+#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
+
int synaptics_detect(struct psmouse *psmouse, int set_properties)
{
struct ps2dev *ps2dev = &psmouse->ps2dev;
@@ -593,6 +601,8 @@ int synaptics_detect(struct psmouse *psm
return 0;
}
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
+
#if defined(__i386__)
#include <linux/dmi.h>
static struct dmi_system_id toshiba_dmi_table[] = {
@@ -679,4 +689,4 @@ #endif
return -1;
}
-
+#endif /* CONFIG_MOUSE_PS2_SYNAPTICS */
--
1.4.1
next prev parent reply other threads:[~2007-01-03 7:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-13 4:31 [PATCH] psmouse split Andres Salomon
2006-12-13 6:08 ` Dmitry Torokhov
2006-12-13 7:21 ` Andres Salomon
2006-12-13 14:12 ` Dmitry Torokhov
2006-12-13 16:43 ` Andres Salomon
2006-12-13 17:47 ` Dmitry Torokhov
2007-01-03 6:48 ` [PATCH] psmouse split [01/03] Andres Salomon
2007-01-03 6:51 ` [PATCH] psmouse split [02/03] Andres Salomon
2007-01-03 6:53 ` Andres Salomon [this message]
2007-01-03 7:36 ` [PATCH] psmouse split [01/03] Sam Ravnborg
2007-01-03 7:50 ` Andres Salomon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=459B52F5.1000402@queued.net \
--to=dilinger@queued.net \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
--cc=warp@aehallh.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.