[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4E9F48A8.3020507@calvaedi.com>
Date: Thu, 20 Oct 2011 00:01:12 +0200
From: John Hughes <john@...vaedi.com>
To: John Hughes <john@...va.COM>
CC: Mattia Dongili <malattia@...ux.it>, Valdis.Kletnieks@...edu,
linux-kernel@...r.kernel.org, Stelian Pop <stelian@...ies.net>,
platform-driver-x86 <platform-driver-x86@...r.kernel.org>
Subject: Re: sony-laptop driver: Volume keys on Sony Vaio TX3 don't work
On 10/18/2011 11:07 AM, John Hughes wrote:
> udev does have some per-model stuff for the Vaio's.
>
> Doesn't work right because the scancodes reported the sony-laptop
> driver are not the right ones.
>
> (sony-laptop sends its "event" code as the scancode, but to change the
> keymap you have to use the index in the sony_laptop_input_keycode_map
> table. I have posted one patch for this which makes the scancodes at
> least consistent but I think I'll do another that makes them be the
> same as what current udev thinks they should be. I'll have that ready
> this evening I thing - have to work now :-( )
>
Ok, here is a patch that makes the scancodes reported by sony-laptop be
the same as the SONY_EVENT defines.
Unfortunately this doesn't work terribly well because the scancodes used
by udev seem to be chosen randomly:
$ cat /lib/udev/keymaps/module-sony
0x06 mute # Fn+F2
0x07 volumedown # Fn+F3
0x08 volumeup # Fn+F4
0x09 brightnessdown # Fn+F5
0x0A brightnessup # Fn+F6
0x0B switchvideomode # Fn+F7
0x0E zoom # Fn+F10
0x10 suspend # Fn+F12
and
$ cat /lib/udev/keymaps/module-sony-vgn
0x00 brightnessdown # Fn+F5
0x10 brightnessup # Fn+F6
0x11 switchvideomode # Fn+F7
0x12 zoomout
0x14 zoomin
0x15 suspend # Fn+F12
0x17 prog1
So the different ideas are:
key module-sony module-sony-vgn orig code(*) event(*)
fn_f1 0x05 0x0c
fn_f2 0x06 0x06 0x0d
fn_f3 0x07 0x07 0x0e
fn_f4 0x08 0x08 0x0f
fn_f5 0x09 0x00 (!) 0x09 0x10
fn_f6 0x0a 0x10 0x0a 0x11
fn_f7 0x0b 0x11 0x0b 0x12
fn_f8 0x0c 0x13
fn_f9 0x0d 0x14
fn_f10 0x0e 0x0e 0x15
fn_f11 0x0f 0x16
fn_f12 0x10 0x15 0x10 0x17
(*) Orig code - the scancodes that map for the original code, and the
scancodes returned by my first patch
(*) event - the scancodes from the patch included here.
So, it seems to me that:
1. my original patch is the smaller change, and works with the udev
"module-sony" keymap file
2. this patch is prettier but doesn't work with existing userspace.
3. the poor sod who wrote the module-sony-vgn file was terribly confused
by the scancodes returned by the original code.
My recommendation would be to use my first patch - it makes the driver
return scancodes that correspond to the scancodes that you need to map.
OK?
Want me to do the whole formal "blablabla-by" stuff now?
View attachment "sony-scancode-event.patch" of type "text/x-patch" (11186 bytes)
Powered by blists - more mailing lists