Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'platform-drivers-x86-v3.18-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform drivers fixlets from Darren Hart:
"Just two patches to remove hp_accel events from the keyboard bus
stream via an i8042 filter"

* tag 'platform-drivers-x86-v3.18-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
platform: hp_accel: Add SERIO_I8042 as a dependency since it now includes i8042.h/serio.h
platform: hp_accel: add a i8042 filter to remove HPQ6000 data from kb bus stream

+45
+1
drivers/platform/x86/Kconfig
··· 202 202 config HP_ACCEL 203 203 tristate "HP laptop accelerometer" 204 204 depends on INPUT && ACPI 205 + depends on SERIO_I8042 205 206 select SENSORS_LIS3LV02D 206 207 select NEW_LEDS 207 208 select LEDS_CLASS
+44
drivers/platform/x86/hp_accel.c
··· 37 37 #include <linux/leds.h> 38 38 #include <linux/atomic.h> 39 39 #include <linux/acpi.h> 40 + #include <linux/i8042.h> 41 + #include <linux/serio.h> 40 42 #include "../../misc/lis3lv02d/lis3lv02d.h" 41 43 42 44 #define DRIVER_NAME "hp_accel" ··· 74 72 } 75 73 76 74 /* HP-specific accelerometer driver ------------------------------------ */ 75 + 76 + /* e0 25, e0 26, e0 27, e0 28 are scan codes that the accelerometer with acpi id 77 + * HPQ6000 sends through the keyboard bus */ 78 + #define ACCEL_1 0x25 79 + #define ACCEL_2 0x26 80 + #define ACCEL_3 0x27 81 + #define ACCEL_4 0x28 77 82 78 83 /* For automatic insertion of the module */ 79 84 static const struct acpi_device_id lis3lv02d_device_ids[] = { ··· 303 294 printk(KERN_DEBUG DRIVER_NAME ": Error getting resources\n"); 304 295 } 305 296 297 + static bool hp_accel_i8042_filter(unsigned char data, unsigned char str, 298 + struct serio *port) 299 + { 300 + static bool extended; 301 + 302 + if (str & I8042_STR_AUXDATA) 303 + return false; 304 + 305 + if (data == 0xe0) { 306 + extended = true; 307 + return true; 308 + } else if (unlikely(extended)) { 309 + extended = false; 310 + 311 + switch (data) { 312 + case ACCEL_1: 313 + case ACCEL_2: 314 + case ACCEL_3: 315 + case ACCEL_4: 316 + return true; 317 + default: 318 + serio_interrupt(port, 0xe0, 0); 319 + return false; 320 + } 321 + } 322 + 323 + return false; 324 + } 325 + 306 326 static int lis3lv02d_add(struct acpi_device *device) 307 327 { 308 328 int ret; ··· 364 326 if (ret) 365 327 return ret; 366 328 329 + /* filter to remove HPQ6000 accelerometer data 330 + * from keyboard bus stream */ 331 + if (strstr(dev_name(&device->dev), "HPQ6000")) 332 + i8042_install_filter(hp_accel_i8042_filter); 333 + 367 334 INIT_WORK(&hpled_led.work, delayed_set_status_worker); 368 335 ret = led_classdev_register(NULL, &hpled_led.led_classdev); 369 336 if (ret) { ··· 386 343 if (!device) 387 344 return -EINVAL; 388 345 346 + i8042_remove_filter(hp_accel_i8042_filter); 389 347 lis3lv02d_joystick_disable(&lis3_dev); 390 348 lis3lv02d_poweroff(&lis3_dev); 391 349