~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic

« back to all changes in this revision

Viewing changes to drivers/platform/x86/dell-laptop.c

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Amit Kucheria, Andy Whitcroft, Colin Watson, Tim Gardner, Ubuntu: 2.6.31-13.43, Ubuntu: 2.6.31-13.42, Ubuntu: 2.6.31-12.41, Ubuntu: 2.6.31-12.40
  • Date: 2009-10-09 14:41:22 UTC
  • Revision ID: james.westby@ubuntu.com-20091009144122-tdxnwe8yr8lbexi8
Tags: 2.6.31-207.15
[ Amit Kucheria ]

* Disable CONFIG_UEVENT_HELPER_PATH

[ Andy Whitcroft ]

* rebase to Ubuntu-2.6.31-13.42
* rebase to Ubuntu-2.6.31-13.43

[ Colin Watson ]

* Use section 'admin' rather than 'base'

[ Tim Gardner ]

* [Config] CONFIG_GFS2_FS_LOCKING_DLM=y
  - LP: #416325

[ Ubuntu: 2.6.31-13.43 ]

* Revert "[Upstream] acerhdf: Limit modalias matching to supported
  boards"
* Use section 'admin' rather than 'base'
* SAUCE: AppArmor: Set error code after structure initialization.
  - LP: #427948
* SAUCE: AppArmor: Fix off by 2 error in getprocattr mem allocation
  - LP: #446595
* SAUCE: Add sr_mod to the scsi-modules udeb for powerpc
* [Upstream] acerhdf: Limit modalias matching to supported boards
  (supersedes previous revert made by Andy Whitcroft)
  - LP: #435958

[ Ubuntu: 2.6.31-13.42 ]

* SAUCE: (drop after 2.6.31) input: Add support for filtering input
  events
  - LP: #430809
* SAUCE: (drop after 2.6.31) dell-laptop: Trigger rfkill updates on wifi
  toggle switch press
  - LP: #430809
* SAUCE: Raise the default console 'quiet' level to 2
  This supresses all but critical and emergency level messages.
  https://lists.ubuntu.com/archives/kernel-team/2009-October/007476.html
* TTY: fix typos
* Linux 2.6.31.3
* V4L/DVB (12439): cx88: add support for WinFast DTV2000H rev. J
  - LP: #433904

[ Ubuntu: 2.6.31-12.41 ]

* [Config] CONFIG_GFS2_FS_LOCKING_DLM=y
  - LP: #416325
* SAUCE: Fix MODULE_IMPORT/MODULE_EXPORT
  The original patch failed to work for amd64.
  - LP: #430694
* ALSA: hda - Add a white-list for MSI option
  Upstream cherry-pick: Infrastructure support for #445580
* ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
  - LP: #445580
* ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO
  VGN-T350P
  - LP: #410933
* ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO
  VGN-B1VP
  - LP: #410933

[ Ubuntu: 2.6.31-12.40 ]

* SAUCE: Created MODULE_EXPORT/MODULE_IMPORT macros
  - LP: #430694
* SAUCE: Use MODULE_IMPORT macro to tie intel_agp to i915
  - LP: #430694
* V4L/DVB (12352): gspca - vc032x: Fix mi1310_soc preview and LED
  - LP: #310760

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <linux/rfkill.h>
23
23
#include <linux/power_supply.h>
24
24
#include <linux/acpi.h>
 
25
#include <linux/input.h>
25
26
#include "../../firmware/dcdbas.h"
26
27
 
27
28
#define BRIGHTNESS_TOKEN 0x7d
210
211
        .query = dell_rfkill_query,
211
212
};
212
213
 
 
214
static void dell_rfkill_update(void)
 
215
{
 
216
        if (wifi_rfkill)
 
217
                dell_rfkill_query(wifi_rfkill, (void *)1);
 
218
        if (bluetooth_rfkill)
 
219
                dell_rfkill_query(bluetooth_rfkill, (void *)2);
 
220
        if (wwan_rfkill)
 
221
                dell_rfkill_query(wwan_rfkill, (void *)3);
 
222
}
 
223
 
213
224
static int dell_setup_rfkill(void)
214
225
{
215
226
        struct calling_interface_buffer buffer;
314
325
        .update_status  = dell_send_intensity,
315
326
};
316
327
 
 
328
static const struct input_device_id dell_input_ids[] = {
 
329
        {
 
330
                .bustype = 0x11,
 
331
                .vendor = 0x01,
 
332
                .product = 0x01,
 
333
                .version = 0xab41,
 
334
                .flags = INPUT_DEVICE_ID_MATCH_BUS |
 
335
                         INPUT_DEVICE_ID_MATCH_VENDOR |
 
336
                         INPUT_DEVICE_ID_MATCH_PRODUCT |
 
337
                         INPUT_DEVICE_ID_MATCH_VERSION
 
338
        },
 
339
        { },
 
340
};
 
341
 
 
342
static bool dell_input_filter(struct input_handle *handle, unsigned int type,
 
343
                             unsigned int code, int value)
 
344
{
 
345
        if (type == EV_KEY && code == KEY_WLAN && value == 1) {
 
346
                dell_rfkill_update();
 
347
                return 1;
 
348
        }
 
349
 
 
350
        return 0;
 
351
}
 
352
 
 
353
static void dell_input_event(struct input_handle *handle, unsigned int type,
 
354
                             unsigned int code, int value)
 
355
{
 
356
}
 
357
 
 
358
static int dell_input_connect(struct input_handler *handler,
 
359
                              struct input_dev *dev,
 
360
                              const struct input_device_id *id)
 
361
{
 
362
        struct input_handle *handle;
 
363
        int error;
 
364
 
 
365
        handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
 
366
        if (!handle)
 
367
                return -ENOMEM;
 
368
 
 
369
        handle->dev = dev;
 
370
        handle->handler = handler;
 
371
        handle->name = "dell-laptop";
 
372
 
 
373
        error = input_register_handle(handle);
 
374
        if (error)
 
375
                goto err_free_handle;
 
376
 
 
377
        error = input_open_device(handle);
 
378
        if (error)
 
379
                goto err_unregister_handle;
 
380
 
 
381
        error = input_filter_device(handle);
 
382
        if (error)
 
383
                goto err_close_handle;
 
384
 
 
385
        return 0;
 
386
 
 
387
err_close_handle:
 
388
        input_close_device(handle);
 
389
err_unregister_handle:
 
390
        input_unregister_handle(handle);
 
391
err_free_handle:
 
392
        kfree(handle);
 
393
        return error;
 
394
}
 
395
 
 
396
static void dell_input_disconnect(struct input_handle *handle)
 
397
{
 
398
        input_close_device(handle);
 
399
        input_unregister_handle(handle);
 
400
        kfree(handle);
 
401
}
 
402
 
 
403
static struct input_handler dell_input_handler = {
 
404
        .name = "dell-laptop",
 
405
        .filter = dell_input_filter,
 
406
        .event = dell_input_event,
 
407
        .connect = dell_input_connect,
 
408
        .disconnect = dell_input_disconnect,
 
409
        .id_table = dell_input_ids,
 
410
};
 
411
 
317
412
static int __init dell_init(void)
318
413
{
319
414
        struct calling_interface_buffer buffer;
337
432
                goto out;
338
433
        }
339
434
 
 
435
        if (input_register_handler(&dell_input_handler))
 
436
                printk(KERN_INFO
 
437
                       "dell-laptop: Could not register input filter\n");
 
438
 
340
439
#ifdef CONFIG_ACPI
341
440
        /* In the event of an ACPI backlight being available, don't
342
441
         * register the platform controller.
392
491
                rfkill_unregister(bluetooth_rfkill);
393
492
        if (wwan_rfkill)
394
493
                rfkill_unregister(wwan_rfkill);
 
494
        input_unregister_handler(&dell_input_handler);
395
495
}
396
496
 
397
497
module_init(dell_init);