* Enabling "extra" scancodes on some Acer laptops
@ 2007-10-14 17:03 Carlos Corbacho
2007-10-16 14:37 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Carlos Corbacho @ 2007-10-14 17:03 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Dimitry,
Here's an interesting one for you. With a few newer Acer laptops, a problem
with some of the extra/ multimedia keys has been cropping up - they don't
emit scancodes by default. The solution found was to resurrect an old quirk
from acerhk to turn them on (acerhk calls this "enabling dritek keyboard
extension"):
/*
* Keyboard controller ports
*/
#define ACER_KBD_STATUS_REG 0x64 /* Status register (R) */
#define ACER_KBD_CNTL_REG 0x64 /* Controller command register (W) */
#define ACER_KBD_DATA_REG 0x60 /* Keyboard data register (R/W) */
/*
* Wait for the keyboard controller to become ready
*/
static int wait_kbd_write(void)
{
int i = 0;
while ((inb(ACER_KBD_STATUS_REG) & 0x02) && (i < 10000)) {
udelay(50);
i++;
}
return -(i == 10000);
}
static void send_kbd_cmd(u8 cmd, u8 val)
{
preempt_disable();
if (!wait_kbd_write())
outb(cmd, ACER_KBD_CNTL_REG);
if (!wait_kbd_write())
outb(val, ACER_KBD_DATA_REG);
preempt_enable_no_resched();
}
static void set_keyboard_quirk(void)
{
send_kbd_cmd(0x59, 0x90);
}
After calling set_keyboard_quirk(), the extra keys start generating proper
scancodes, and can be mapped as normal via setkeycodes.
At the moment, I've added this quirk to acer_acpi (it's currently only applied
on the few systems we know that need it via DMI matching), but I'm not really
sure if this is the right place for it as:
1) acer_acpi is still out of tree
2) Does this really belong in acer_acpi (I'm not really sure if it falls under
what I'm doing - this seems to border a bit too much on the input tree side),
or somewhere further up the input tree (wistron-btns isn't much use here, as
the quirk would then be limited to 32 bit only, whereas some of the machines
that need this quirk can run a 64 bit kernel)?
-Carlos
--
E-Mail: cathectic@gmail.com
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Enabling "extra" scancodes on some Acer laptops
2007-10-14 17:03 Enabling "extra" scancodes on some Acer laptops Carlos Corbacho
@ 2007-10-16 14:37 ` Dmitry Torokhov
2007-10-16 15:12 ` Carlos Corbacho
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2007-10-16 14:37 UTC (permalink / raw)
To: Carlos Corbacho; +Cc: linux-input
Hi Carlos,
On 10/14/07, Carlos Corbacho <cathectic@slackadelic.com> wrote:
>
> After calling set_keyboard_quirk(), the extra keys start generating proper
> scancodes, and can be mapped as normal via setkeycodes.
>
> At the moment, I've added this quirk to acer_acpi (it's currently only applied
> on the few systems we know that need it via DMI matching), but I'm not really
> sure if this is the right place for it as:
>
> 1) acer_acpi is still out of tree
>
> 2) Does this really belong in acer_acpi (I'm not really sure if it falls under
> what I'm doing - this seems to border a bit too much on the input tree side),
> or somewhere further up the input tree (wistron-btns isn't much use here, as
> the quirk would then be limited to 32 bit only, whereas some of the machines
> that need this quirk can run a 64 bit kernel)?
>
I think it could be added to i8042 driver to enable it. How messy is detection?
I am also going to apply the patch that exports i8042_command() so it
can be used by other modules (Clevo LED driver needs it).
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Enabling "extra" scancodes on some Acer laptops
2007-10-16 14:37 ` Dmitry Torokhov
@ 2007-10-16 15:12 ` Carlos Corbacho
2007-10-16 15:52 ` Dmitry Torokhov
0 siblings, 1 reply; 5+ messages in thread
From: Carlos Corbacho @ 2007-10-16 15:12 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Dimitry,
On Tuesday 16 October 2007 15:37:37 you wrote:
> I think it could be added to i8042 driver to enable it. How messy is
> detection?
I use simple DMI matching in acer_acpi to do this on known broken laptops.
(acerhk calls directly into the BIOS to find this information - but I suspect
the data from that could easily be extracted and converted to proper DMI
table entries).
These are the the three that I know of (and are supported by acer_acpi) that
require this quirk:
static struct dmi_system_id dritek_extension_quirk[] = {
{
.callback = dmi_matched,
.ident = "Acer Aspire 5650",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
},
},
{
.callback = dmi_matched,
.ident = "Acer Aspire 5680",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
},
},
{
.callback = dmi_matched,
.ident = "Acer TravelMate 2490",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
},
},
{}
};
-Carlos
--
E-Mail: cathectic@gmail.com
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Enabling "extra" scancodes on some Acer laptops
2007-10-16 15:12 ` Carlos Corbacho
@ 2007-10-16 15:52 ` Dmitry Torokhov
2007-12-11 18:28 ` Carlos Corbacho
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2007-10-16 15:52 UTC (permalink / raw)
To: Carlos Corbacho; +Cc: linux-input
On 10/16/07, Carlos Corbacho <cathectic@slackadelic.com> wrote:
> Dimitry,
>
> On Tuesday 16 October 2007 15:37:37 you wrote:
> > I think it could be added to i8042 driver to enable it. How messy is
> > detection?
>
> I use simple DMI matching in acer_acpi to do this on known broken laptops.
>
> (acerhk calls directly into the BIOS to find this information - but I suspect
> the data from that could easily be extracted and converted to proper DMI
> table entries).
>
> These are the the three that I know of (and are supported by acer_acpi) that
> require this quirk:
>
> static struct dmi_system_id dritek_extension_quirk[] = {
> {
> .callback = dmi_matched,
> .ident = "Acer Aspire 5650",
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
> },
> },
> {
> .callback = dmi_matched,
> .ident = "Acer Aspire 5680",
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
> },
> },
> {
> .callback = dmi_matched,
> .ident = "Acer TravelMate 2490",
> .matches = {
> DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
> },
> },
> {}
> };
>
OK, we should be able to add it to i8042 pretty easily.
--
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Enabling "extra" scancodes on some Acer laptops
2007-10-16 15:52 ` Dmitry Torokhov
@ 2007-12-11 18:28 ` Carlos Corbacho
0 siblings, 0 replies; 5+ messages in thread
From: Carlos Corbacho @ 2007-12-11 18:28 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
On Tuesday 16 October 2007 16:52:17 Dmitry Torokhov wrote:
> > On Tuesday 16 October 2007 15:37:37 you wrote:
> > > I think it could be added to i8042 driver to enable it. How messy is
> > > detection?
> >
> > I use simple DMI matching in acer_acpi to do this on known broken
> > laptops.
> >
> > (acerhk calls directly into the BIOS to find this information - but I
> > suspect the data from that could easily be extracted and converted to
> > proper DMI table entries).
> >
> > These are the the three that I know of (and are supported by acer_acpi)
> > that require this quirk:
> >
> > static struct dmi_system_id dritek_extension_quirk[] = {
> > {
> > .callback = dmi_matched,
> > .ident = "Acer Aspire 5650",
> > .matches = {
> > DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> > DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
> > },
> > },
> > [etc...]
> > };
>
> OK, we should be able to add it to i8042 pretty easily.
Ok, I completely forgot about this thread...
Dmitry - where would be the best place to add this? Put the DMI matching in
i8042-x86ia64io.h, and then run the quirk somewhere in i8042.c?
-Carlos
--
E-Mail: carlos@strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-12-11 18:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-14 17:03 Enabling "extra" scancodes on some Acer laptops Carlos Corbacho
2007-10-16 14:37 ` Dmitry Torokhov
2007-10-16 15:12 ` Carlos Corbacho
2007-10-16 15:52 ` Dmitry Torokhov
2007-12-11 18:28 ` Carlos Corbacho
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).