* [PATCH] Input: psmouse - retry getid command in psmouse_probe()
@ 2012-10-31 10:11 Chung-yih Wang
[not found] ` <CAM2ehZbMyNP_AhP-9TmCC5-bw9mqd7yunTy3NETEqRX1bX5oYg@mail.gmail.com>
2013-02-18 9:26 ` li guang
0 siblings, 2 replies; 5+ messages in thread
From: Chung-yih Wang @ 2012-10-31 10:11 UTC (permalink / raw)
To: linux-input
Cc: Dmitry Torokhov, Tai-hwa Liang, Rusty Russell, Paul Fox,
Chung-yih Wang, linux-kernel
As the synaptics device may not respond to the first command in psmouse_probe
when a machine is booting up, the patch gives a second probe if the first
one fails.
Signed-off-by: Chung-yih Wang <cywang@chromium.org>
---
drivers/input/mouse/psmouse-base.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 22fe254..c4fc5ad 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
*/
param[0] = 0xa5;
- if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
- return -1;
+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
+ /*
+ * Reprobe the device if it did not respond to the GETID
+ * command. Before retry, additional dummy command is sent
+ * to clear the 'RESEND' response if exists.
+ */
+ psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
+ return -1;
+ }
if (param[0] != 0x00 && param[0] != 0x03 &&
param[0] != 0x04 && param[0] != 0xff)
--
1.7.7.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()
[not found] ` <CAM2ehZbMyNP_AhP-9TmCC5-bw9mqd7yunTy3NETEqRX1bX5oYg@mail.gmail.com>
@ 2013-02-18 8:21 ` Chung-Yih Wang (王崇懿)
0 siblings, 0 replies; 5+ messages in thread
From: Chung-Yih Wang (王崇懿) @ 2013-02-18 8:21 UTC (permalink / raw)
To: linux-input, Andrew de los Reyes, Daniel Kurtz
Cc: Dmitry Torokhov, Tai-hwa Liang, Rusty Russell, Paul Fox,
Chung-yih Wang, linux-kernel
Hi Dmitry and other maintainers,
Not sure if you have any comment on the patch? As this patch tries
to help some platforms (especially for lenovo's machines) to rescan
the touchpad device after resuming from suspend if the first probe
fails.
Thanks,
Chung-yih
On Mon, Feb 18, 2013 at 4:17 PM, Chung-Yih Wang (王崇懿)
<cywang@chromium.org> wrote:
> Hi Dmitry and other maintainers,
>
> Not sure if you have any comment on the patch? As this patch tries to help
> some platforms (especially for lenovo's machines) to rescan the touchpad
> device after resuming from suspend if the first probe fails.
>
> Thanks,
> Chung-yih
>
>
> On Wed, Oct 31, 2012 at 6:11 PM, Chung-yih Wang <cywang@chromium.org> wrote:
>>
>> As the synaptics device may not respond to the first command in
>> psmouse_probe
>> when a machine is booting up, the patch gives a second probe if the first
>> one fails.
>>
>> Signed-off-by: Chung-yih Wang <cywang@chromium.org>
>> ---
>> drivers/input/mouse/psmouse-base.c | 13 +++++++++++--
>> 1 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/input/mouse/psmouse-base.c
>> b/drivers/input/mouse/psmouse-base.c
>> index 22fe254..c4fc5ad 100644
>> --- a/drivers/input/mouse/psmouse-base.c
>> +++ b/drivers/input/mouse/psmouse-base.c
>> @@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
>> */
>>
>> param[0] = 0xa5;
>> - if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
>> - return -1;
>> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
>> + /*
>> + * Reprobe the device if it did not respond to the GETID
>> + * command. Before retry, additional dummy command is sent
>> + * to clear the 'RESEND' response if exists.
>> + */
>> + psmouse_warn(psmouse, "GETID probe failed,
>> retrying...\n");
>> + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
>> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
>> + return -1;
>> + }
>>
>> if (param[0] != 0x00 && param[0] != 0x03 &&
>> param[0] != 0x04 && param[0] != 0xff)
>> --
>> 1.7.7.3
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()
2012-10-31 10:11 [PATCH] Input: psmouse - retry getid command in psmouse_probe() Chung-yih Wang
[not found] ` <CAM2ehZbMyNP_AhP-9TmCC5-bw9mqd7yunTy3NETEqRX1bX5oYg@mail.gmail.com>
@ 2013-02-18 9:26 ` li guang
2013-02-18 9:45 ` Chung-Yih Wang (王崇懿)
1 sibling, 1 reply; 5+ messages in thread
From: li guang @ 2013-02-18 9:26 UTC (permalink / raw)
To: Chung-yih Wang
Cc: linux-input, Dmitry Torokhov, Tai-hwa Liang, Rusty Russell,
Paul Fox, linux-kernel
seems a special change for a special device
so, you may need to place this change with
corresponding CONFIG_xxx_xxx.
generally, if command F2 failed, we will assume
there's no ps2 device, it's normal,
or do you have some materials(SPEC) to specify
the change you have made?
在 2012-10-31三的 18:11 +0800,Chung-yih Wang写道:
> As the synaptics device may not respond to the first command in psmouse_probe
> when a machine is booting up, the patch gives a second probe if the first
> one fails.
>
> Signed-off-by: Chung-yih Wang <cywang@chromium.org>
> ---
> drivers/input/mouse/psmouse-base.c | 13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
> index 22fe254..c4fc5ad 100644
> --- a/drivers/input/mouse/psmouse-base.c
> +++ b/drivers/input/mouse/psmouse-base.c
> @@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
> */
>
> param[0] = 0xa5;
> - if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
> - return -1;
> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
> + /*
> + * Reprobe the device if it did not respond to the GETID
> + * command. Before retry, additional dummy command is sent
> + * to clear the 'RESEND' response if exists.
> + */
> + psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
> + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
> + return -1;
> + }
>
> if (param[0] != 0x00 && param[0] != 0x03 &&
> param[0] != 0x04 && param[0] != 0xff)
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()
2013-02-18 9:26 ` li guang
@ 2013-02-18 9:45 ` Chung-Yih Wang (王崇懿)
2013-02-19 18:44 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Chung-Yih Wang (王崇懿) @ 2013-02-18 9:45 UTC (permalink / raw)
To: li guang
Cc: linux-input, Dmitry Torokhov, Tai-hwa Liang, Rusty Russell,
Paul Fox, linux-kernel
Yes, I could add CONFIG_MOUSE_PS2_SYNAPTICS for the change as we only
need it for synaptics touchpad/touchpoint on lenovo's machines.
On Mon, Feb 18, 2013 at 5:26 PM, li guang <lig.fnst@cn.fujitsu.com> wrote:
> seems a special change for a special device
> so, you may need to place this change with
> corresponding CONFIG_xxx_xxx.
> generally, if command F2 failed, we will assume
> there's no ps2 device, it's normal,
> or do you have some materials(SPEC) to specify
> the change you have made?
>
>
>
> 在 2012-10-31三的 18:11 +0800,Chung-yih Wang写道:
>> As the synaptics device may not respond to the first command in psmouse_probe
>> when a machine is booting up, the patch gives a second probe if the first
>> one fails.
>>
>> Signed-off-by: Chung-yih Wang <cywang@chromium.org>
>> ---
>> drivers/input/mouse/psmouse-base.c | 13 +++++++++++--
>> 1 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
>> index 22fe254..c4fc5ad 100644
>> --- a/drivers/input/mouse/psmouse-base.c
>> +++ b/drivers/input/mouse/psmouse-base.c
>> @@ -1053,8 +1053,17 @@ static int psmouse_probe(struct psmouse *psmouse)
>> */
>>
>> param[0] = 0xa5;
>> - if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
>> - return -1;
>> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID)) {
>> + /*
>> + * Reprobe the device if it did not respond to the GETID
>> + * command. Before retry, additional dummy command is sent
>> + * to clear the 'RESEND' response if exists.
>> + */
>> + psmouse_warn(psmouse, "GETID probe failed, retrying...\n");
>> + ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11);
>> + if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))
>> + return -1;
>> + }
>>
>> if (param[0] != 0x00 && param[0] != 0x03 &&
>> param[0] != 0x04 && param[0] != 0xff)
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Input: psmouse - retry getid command in psmouse_probe()
2013-02-18 9:45 ` Chung-Yih Wang (王崇懿)
@ 2013-02-19 18:44 ` Dmitry Torokhov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2013-02-19 18:44 UTC (permalink / raw)
To: Chung-Yih Wang (王崇懿)
Cc: li guang, linux-input, Tai-hwa Liang, Rusty Russell, Paul Fox,
linux-kernel
Hi Chung-yih,
On Mon, Feb 18, 2013 at 05:45:07PM +0800, Chung-Yih Wang (王崇懿) wrote:
> Yes, I could add CONFIG_MOUSE_PS2_SYNAPTICS for the change as we only
> need it for synaptics touchpad/touchpoint on lenovo's machines.
>
I do not think it will solve anything as all distributions have
CONFIG_MOUSE_PS2_SYNAPTICS enabled.
Could you tell me what the response is to the initial GETID command that
you see on these laptops?
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-19 18:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 10:11 [PATCH] Input: psmouse - retry getid command in psmouse_probe() Chung-yih Wang
[not found] ` <CAM2ehZbMyNP_AhP-9TmCC5-bw9mqd7yunTy3NETEqRX1bX5oYg@mail.gmail.com>
2013-02-18 8:21 ` Chung-Yih Wang (王崇懿)
2013-02-18 9:26 ` li guang
2013-02-18 9:45 ` Chung-Yih Wang (王崇懿)
2013-02-19 18:44 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).