Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296954
b: refs/heads/master
c: 747a562
h: refs/heads/master
v: v3
  • Loading branch information
John Hughes authored and Matthew Garrett committed Mar 20, 2012
1 parent b04feb1 commit c64bf84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d6446628a92a2cf706c256606b3031fc72a763e
refs/heads/master: 747a562f342895bbb6cfdfcb82104b4b2ae566e6
5 changes: 5 additions & 0 deletions trunk/Documentation/laptops/sony-laptop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ subsystem. See the logs of acpid or /proc/acpi/event and
devices are created by the driver. Additionally, loading the driver with the
debug option will report all events in the kernel log.

The "scancodes" passed to the input system (that can be remapped with udev)
are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c
module. For example the "FN/E" key combination (EJECTCD on some models)
generates the scancode 20 (0x14).

Backlight control:
------------------
If your laptop model supports it, you will find sysfs files in the
Expand Down
13 changes: 8 additions & 5 deletions trunk/drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ static void sony_laptop_report_input_event(u8 event)
struct input_dev *jog_dev = sony_laptop_input.jog_dev;
struct input_dev *key_dev = sony_laptop_input.key_dev;
struct sony_laptop_keypress kp = { NULL };
int scancode = -1;

if (event == SONYPI_EVENT_FNKEY_RELEASED ||
event == SONYPI_EVENT_ANYBUTTON_RELEASED) {
Expand Down Expand Up @@ -380,18 +381,20 @@ static void sony_laptop_report_input_event(u8 event)
dprintk("sony_laptop_report_input_event, event not known: %d\n", event);
break;
}
if (sony_laptop_input_index[event] != -1) {
kp.key = sony_laptop_input_keycode_map[sony_laptop_input_index[event]];
if ((scancode = sony_laptop_input_index[event]) != -1) {
kp.key = sony_laptop_input_keycode_map[scancode];
if (kp.key != KEY_UNKNOWN)
kp.dev = key_dev;
}
break;
}

if (kp.dev) {
/* if we have a scancode we emit it so we can always
remap the key */
if (scancode != -1)
input_event(kp.dev, EV_MSC, MSC_SCAN, scancode);
input_report_key(kp.dev, kp.key, 1);
/* we emit the scancode so we can always remap the key */
input_event(kp.dev, EV_MSC, MSC_SCAN, event);
input_sync(kp.dev);

/* schedule key release */
Expand Down Expand Up @@ -466,7 +469,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device)
jog_dev->name = "Sony Vaio Jogdial";
jog_dev->id.bustype = BUS_ISA;
jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
key_dev->dev.parent = &acpi_device->dev;
jog_dev->dev.parent = &acpi_device->dev;

input_set_capability(jog_dev, EV_KEY, BTN_MIDDLE);
input_set_capability(jog_dev, EV_REL, REL_WHEEL);
Expand Down

0 comments on commit c64bf84

Please sign in to comment.