diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-01-08 10:02:44 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-01 22:26:07 -0500 |
commit | f74a27d4bda42ee779940adaa34c5c196dda5d32 (patch) | |
tree | 195e9944e7a31734c51fbf72c5ff4851d55ab5e4 /drivers/misc/thinkpad_acpi.c | |
parent | 0c78039fcdb0806fafcc40400ace7fb7e81c65a5 (diff) |
ACPI: thinkpad-acpi: spring cleanup part 2
Move most subdriver-related stuff imported from the header file closer to
their subdriver code. Also, delete unneeded forward declarations.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 613 |
1 files changed, 185 insertions, 428 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 59b127cff1ec..e435b554a004 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -82,8 +82,6 @@ | |||
82 | * 2004-08-09 0.1 initial release, support for X series | 82 | * 2004-08-09 0.1 initial release, support for X series |
83 | */ | 83 | */ |
84 | 84 | ||
85 | /* ==================================================== BEGIN HEADER */ | ||
86 | |||
87 | #include <linux/kernel.h> | 85 | #include <linux/kernel.h> |
88 | #include <linux/module.h> | 86 | #include <linux/module.h> |
89 | #include <linux/init.h> | 87 | #include <linux/init.h> |
@@ -199,79 +197,22 @@ static const char *str_supported(int is_supported); | |||
199 | /* ACPI HIDs */ | 197 | /* ACPI HIDs */ |
200 | #define IBM_HKEY_HID "IBM0068" | 198 | #define IBM_HKEY_HID "IBM0068" |
201 | 199 | ||
202 | /* ACPI helpers */ | ||
203 | static int __must_check acpi_evalf(acpi_handle handle, | ||
204 | void *res, char *method, char *fmt, ...); | ||
205 | static int __must_check acpi_ec_read(int i, u8 * p); | ||
206 | static int __must_check acpi_ec_write(int i, u8 v); | ||
207 | static int __must_check _sta(acpi_handle handle); | ||
208 | |||
209 | /* ACPI handles */ | ||
210 | static acpi_handle root_handle; /* root namespace */ | ||
211 | static acpi_handle ec_handle; /* EC */ | ||
212 | static acpi_handle ecrd_handle, ecwr_handle; /* 570 EC access */ | ||
213 | static acpi_handle cmos_handle, hkey_handle; /* basic thinkpad handles */ | ||
214 | |||
215 | static void drv_acpi_handle_init(char *name, | ||
216 | acpi_handle *handle, acpi_handle parent, | ||
217 | char **paths, int num_paths, char **path); | ||
218 | #define IBM_ACPIHANDLE_INIT(object) \ | ||
219 | drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \ | ||
220 | object##_paths, ARRAY_SIZE(object##_paths), &object##_path) | ||
221 | |||
222 | /* ThinkPad ACPI helpers */ | ||
223 | static int issue_thinkpad_cmos_command(int cmos_cmd); | ||
224 | |||
225 | /* procfs support */ | ||
226 | static struct proc_dir_entry *proc_dir; | ||
227 | |||
228 | /* procfs helpers */ | ||
229 | static int dispatch_procfs_read(char *page, char **start, off_t off, | ||
230 | int count, int *eof, void *data); | ||
231 | static int dispatch_procfs_write(struct file *file, | ||
232 | const char __user * userbuf, | ||
233 | unsigned long count, void *data); | ||
234 | static char *next_cmd(char **cmds); | ||
235 | |||
236 | /* sysfs support */ | 200 | /* sysfs support */ |
237 | struct attribute_set { | 201 | struct attribute_set { |
238 | unsigned int members, max_members; | 202 | unsigned int members, max_members; |
239 | struct attribute_group group; | 203 | struct attribute_group group; |
240 | }; | 204 | }; |
241 | 205 | ||
242 | static struct attribute_set *create_attr_set(unsigned int max_members, | 206 | /* Helpers */ |
243 | const char* name); | ||
244 | #define destroy_attr_set(_set) \ | ||
245 | kfree(_set); | ||
246 | static int add_to_attr_set(struct attribute_set* s, struct attribute *attr); | ||
247 | static int add_many_to_attr_set(struct attribute_set* s, | ||
248 | struct attribute **attr, | ||
249 | unsigned int count); | ||
250 | #define register_attr_set_with_sysfs(_attr_set, _kobj) \ | ||
251 | sysfs_create_group(_kobj, &_attr_set->group) | ||
252 | static void delete_attr_set(struct attribute_set* s, struct kobject *kobj); | ||
253 | |||
254 | static int parse_strtoul(const char *buf, unsigned long max, | 207 | static int parse_strtoul(const char *buf, unsigned long max, |
255 | unsigned long *value); | 208 | unsigned long *value); |
256 | 209 | ||
257 | /* Device model */ | ||
258 | static struct platform_device *tpacpi_pdev; | ||
259 | static struct platform_device *tpacpi_sensors_pdev; | ||
260 | static struct device *tpacpi_hwmon; | ||
261 | static struct platform_driver tpacpi_pdriver; | ||
262 | static struct input_dev *tpacpi_inputdev; | ||
263 | static int tpacpi_create_driver_attributes(struct device_driver *drv); | ||
264 | static void tpacpi_remove_driver_attributes(struct device_driver *drv); | ||
265 | |||
266 | /* Module */ | 210 | /* Module */ |
267 | static int experimental; | 211 | static int experimental; |
268 | static u32 dbg_level; | 212 | static u32 dbg_level; |
269 | static int force_load; | 213 | static int force_load; |
270 | static unsigned int hotkey_report_mode; | 214 | static unsigned int hotkey_report_mode; |
271 | 215 | ||
272 | static int thinkpad_acpi_module_init(void); | ||
273 | static void thinkpad_acpi_module_exit(void); | ||
274 | |||
275 | 216 | ||
276 | /**************************************************************************** | 217 | /**************************************************************************** |
277 | * Subdrivers | 218 | * Subdrivers |
@@ -354,365 +295,9 @@ struct thinkpad_id_data { | |||
354 | 295 | ||
355 | char *model_str; | 296 | char *model_str; |
356 | }; | 297 | }; |
357 | |||
358 | static struct thinkpad_id_data thinkpad_id; | 298 | static struct thinkpad_id_data thinkpad_id; |
359 | 299 | ||
360 | static struct list_head tpacpi_all_drivers; | 300 | static LIST_HEAD(tpacpi_all_drivers); |
361 | |||
362 | static struct ibm_init_struct ibms_init[]; | ||
363 | static int set_ibm_param(const char *val, struct kernel_param *kp); | ||
364 | static int ibm_init(struct ibm_init_struct *iibm); | ||
365 | static void ibm_exit(struct ibm_struct *ibm); | ||
366 | |||
367 | |||
368 | /* | ||
369 | * procfs master subdriver | ||
370 | */ | ||
371 | static int thinkpad_acpi_driver_init(struct ibm_init_struct *iibm); | ||
372 | static int thinkpad_acpi_driver_read(char *p); | ||
373 | |||
374 | |||
375 | /* | ||
376 | * Bay subdriver | ||
377 | */ | ||
378 | |||
379 | #ifdef CONFIG_THINKPAD_ACPI_BAY | ||
380 | static acpi_handle bay_handle, bay_ej_handle; | ||
381 | static acpi_handle bay2_handle, bay2_ej_handle; | ||
382 | |||
383 | static int bay_init(struct ibm_init_struct *iibm); | ||
384 | static void bay_notify(struct ibm_struct *ibm, u32 event); | ||
385 | static int bay_read(char *p); | ||
386 | static int bay_write(char *buf); | ||
387 | #endif /* CONFIG_THINKPAD_ACPI_BAY */ | ||
388 | |||
389 | |||
390 | /* | ||
391 | * Beep subdriver | ||
392 | */ | ||
393 | |||
394 | static acpi_handle beep_handle; | ||
395 | |||
396 | static int beep_read(char *p); | ||
397 | static int beep_write(char *buf); | ||
398 | |||
399 | |||
400 | /* | ||
401 | * Bluetooth subdriver | ||
402 | */ | ||
403 | |||
404 | enum { | ||
405 | /* ACPI GBDC/SBDC bits */ | ||
406 | TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ | ||
407 | TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */ | ||
408 | TP_ACPI_BLUETOOTH_UNK = 0x04, /* unknown function */ | ||
409 | }; | ||
410 | |||
411 | static int bluetooth_init(struct ibm_init_struct *iibm); | ||
412 | static int bluetooth_get_radiosw(void); | ||
413 | static int bluetooth_set_radiosw(int radio_on); | ||
414 | static int bluetooth_read(char *p); | ||
415 | static int bluetooth_write(char *buf); | ||
416 | |||
417 | |||
418 | /* | ||
419 | * Brightness (backlight) subdriver | ||
420 | */ | ||
421 | |||
422 | #define TPACPI_BACKLIGHT_DEV_NAME "thinkpad_screen" | ||
423 | |||
424 | static struct backlight_device *ibm_backlight_device; | ||
425 | static int brightness_offset = 0x31; | ||
426 | static int brightness_mode; | ||
427 | static unsigned int brightness_enable; /* 0 = no, 1 = yes, 2 = auto */ | ||
428 | |||
429 | static int brightness_init(struct ibm_init_struct *iibm); | ||
430 | static void brightness_exit(void); | ||
431 | static int brightness_get(struct backlight_device *bd); | ||
432 | static int brightness_set(int value); | ||
433 | static int brightness_update_status(struct backlight_device *bd); | ||
434 | static int brightness_read(char *p); | ||
435 | static int brightness_write(char *buf); | ||
436 | |||
437 | |||
438 | /* | ||
439 | * CMOS subdriver | ||
440 | */ | ||
441 | |||
442 | static int cmos_read(char *p); | ||
443 | static int cmos_write(char *buf); | ||
444 | |||
445 | |||
446 | /* | ||
447 | * Dock subdriver | ||
448 | */ | ||
449 | |||
450 | #ifdef CONFIG_THINKPAD_ACPI_DOCK | ||
451 | static acpi_handle pci_handle; | ||
452 | static acpi_handle dock_handle; | ||
453 | |||
454 | static void dock_notify(struct ibm_struct *ibm, u32 event); | ||
455 | static int dock_read(char *p); | ||
456 | static int dock_write(char *buf); | ||
457 | #endif /* CONFIG_THINKPAD_ACPI_DOCK */ | ||
458 | |||
459 | |||
460 | /* | ||
461 | * EC dump subdriver | ||
462 | */ | ||
463 | |||
464 | static int ecdump_read(char *p) ; | ||
465 | static int ecdump_write(char *buf); | ||
466 | |||
467 | |||
468 | /* | ||
469 | * Fan subdriver | ||
470 | */ | ||
471 | |||
472 | enum { /* Fan control constants */ | ||
473 | fan_status_offset = 0x2f, /* EC register 0x2f */ | ||
474 | fan_rpm_offset = 0x84, /* EC register 0x84: LSB, 0x85 MSB (RPM) | ||
475 | * 0x84 must be read before 0x85 */ | ||
476 | |||
477 | TP_EC_FAN_FULLSPEED = 0x40, /* EC fan mode: full speed */ | ||
478 | TP_EC_FAN_AUTO = 0x80, /* EC fan mode: auto fan control */ | ||
479 | |||
480 | TPACPI_FAN_LAST_LEVEL = 0x100, /* Use cached last-seen fan level */ | ||
481 | }; | ||
482 | |||
483 | enum fan_status_access_mode { | ||
484 | TPACPI_FAN_NONE = 0, /* No fan status or control */ | ||
485 | TPACPI_FAN_RD_ACPI_GFAN, /* Use ACPI GFAN */ | ||
486 | TPACPI_FAN_RD_TPEC, /* Use ACPI EC regs 0x2f, 0x84-0x85 */ | ||
487 | }; | ||
488 | |||
489 | enum fan_control_access_mode { | ||
490 | TPACPI_FAN_WR_NONE = 0, /* No fan control */ | ||
491 | TPACPI_FAN_WR_ACPI_SFAN, /* Use ACPI SFAN */ | ||
492 | TPACPI_FAN_WR_TPEC, /* Use ACPI EC reg 0x2f */ | ||
493 | TPACPI_FAN_WR_ACPI_FANS, /* Use ACPI FANS and EC reg 0x2f */ | ||
494 | }; | ||
495 | |||
496 | enum fan_control_commands { | ||
497 | TPACPI_FAN_CMD_SPEED = 0x0001, /* speed command */ | ||
498 | TPACPI_FAN_CMD_LEVEL = 0x0002, /* level command */ | ||
499 | TPACPI_FAN_CMD_ENABLE = 0x0004, /* enable/disable cmd, | ||
500 | * and also watchdog cmd */ | ||
501 | }; | ||
502 | |||
503 | static int fan_control_allowed; | ||
504 | |||
505 | static enum fan_status_access_mode fan_status_access_mode; | ||
506 | static enum fan_control_access_mode fan_control_access_mode; | ||
507 | static enum fan_control_commands fan_control_commands; | ||
508 | static u8 fan_control_initial_status; | ||
509 | static u8 fan_control_desired_level; | ||
510 | static int fan_watchdog_maxinterval; | ||
511 | |||
512 | static struct mutex fan_mutex; | ||
513 | |||
514 | static acpi_handle fans_handle, gfan_handle, sfan_handle; | ||
515 | |||
516 | static int fan_init(struct ibm_init_struct *iibm); | ||
517 | static void fan_exit(void); | ||
518 | static int fan_get_status(u8 *status); | ||
519 | static int fan_get_status_safe(u8 *status); | ||
520 | static int fan_get_speed(unsigned int *speed); | ||
521 | static void fan_update_desired_level(u8 status); | ||
522 | static void fan_watchdog_fire(struct work_struct *ignored); | ||
523 | static void fan_watchdog_reset(void); | ||
524 | static int fan_set_level(int level); | ||
525 | static int fan_set_level_safe(int level); | ||
526 | static int fan_set_enable(void); | ||
527 | static int fan_set_disable(void); | ||
528 | static int fan_set_speed(int speed); | ||
529 | static int fan_read(char *p); | ||
530 | static int fan_write(char *buf); | ||
531 | static int fan_write_cmd_level(const char *cmd, int *rc); | ||
532 | static int fan_write_cmd_enable(const char *cmd, int *rc); | ||
533 | static int fan_write_cmd_disable(const char *cmd, int *rc); | ||
534 | static int fan_write_cmd_speed(const char *cmd, int *rc); | ||
535 | static int fan_write_cmd_watchdog(const char *cmd, int *rc); | ||
536 | |||
537 | |||
538 | /* | ||
539 | * Hotkey subdriver | ||
540 | */ | ||
541 | |||
542 | enum { /* hot key scan codes (derived from ACPI DSDT) */ | ||
543 | TP_ACPI_HOTKEYSCAN_FNF1 = 0, | ||
544 | TP_ACPI_HOTKEYSCAN_FNF2, | ||
545 | TP_ACPI_HOTKEYSCAN_FNF3, | ||
546 | TP_ACPI_HOTKEYSCAN_FNF4, | ||
547 | TP_ACPI_HOTKEYSCAN_FNF5, | ||
548 | TP_ACPI_HOTKEYSCAN_FNF6, | ||
549 | TP_ACPI_HOTKEYSCAN_FNF7, | ||
550 | TP_ACPI_HOTKEYSCAN_FNF8, | ||
551 | TP_ACPI_HOTKEYSCAN_FNF9, | ||
552 | TP_ACPI_HOTKEYSCAN_FNF10, | ||
553 | TP_ACPI_HOTKEYSCAN_FNF11, | ||
554 | TP_ACPI_HOTKEYSCAN_FNF12, | ||
555 | TP_ACPI_HOTKEYSCAN_FNBACKSPACE, | ||
556 | TP_ACPI_HOTKEYSCAN_FNINSERT, | ||
557 | TP_ACPI_HOTKEYSCAN_FNDELETE, | ||
558 | TP_ACPI_HOTKEYSCAN_FNHOME, | ||
559 | TP_ACPI_HOTKEYSCAN_FNEND, | ||
560 | TP_ACPI_HOTKEYSCAN_FNPAGEUP, | ||
561 | TP_ACPI_HOTKEYSCAN_FNPAGEDOWN, | ||
562 | TP_ACPI_HOTKEYSCAN_FNSPACE, | ||
563 | TP_ACPI_HOTKEYSCAN_VOLUMEUP, | ||
564 | TP_ACPI_HOTKEYSCAN_VOLUMEDOWN, | ||
565 | TP_ACPI_HOTKEYSCAN_MUTE, | ||
566 | TP_ACPI_HOTKEYSCAN_THINKPAD, | ||
567 | }; | ||
568 | |||
569 | static int hotkey_orig_status; | ||
570 | static u32 hotkey_orig_mask; | ||
571 | |||
572 | static struct mutex hotkey_mutex; | ||
573 | |||
574 | static int hotkey_init(struct ibm_init_struct *iibm); | ||
575 | static void hotkey_exit(void); | ||
576 | static void hotkey_notify(struct ibm_struct *ibm, u32 event); | ||
577 | static int hotkey_read(char *p); | ||
578 | static int hotkey_write(char *buf); | ||
579 | |||
580 | |||
581 | /* | ||
582 | * LED subdriver | ||
583 | */ | ||
584 | |||
585 | enum led_access_mode { | ||
586 | TPACPI_LED_NONE = 0, | ||
587 | TPACPI_LED_570, /* 570 */ | ||
588 | TPACPI_LED_OLD, /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20-21 */ | ||
589 | TPACPI_LED_NEW, /* all others */ | ||
590 | }; | ||
591 | |||
592 | enum { /* For TPACPI_LED_OLD */ | ||
593 | TPACPI_LED_EC_HLCL = 0x0c, /* EC reg to get led to power on */ | ||
594 | TPACPI_LED_EC_HLBL = 0x0d, /* EC reg to blink a lit led */ | ||
595 | TPACPI_LED_EC_HLMS = 0x0e, /* EC reg to select led to command */ | ||
596 | }; | ||
597 | |||
598 | static enum led_access_mode led_supported; | ||
599 | static acpi_handle led_handle; | ||
600 | |||
601 | static int led_init(struct ibm_init_struct *iibm); | ||
602 | static int led_read(char *p); | ||
603 | static int led_write(char *buf); | ||
604 | |||
605 | /* | ||
606 | * Light (thinklight) subdriver | ||
607 | */ | ||
608 | |||
609 | static acpi_handle lght_handle, ledb_handle; | ||
610 | |||
611 | static int light_init(struct ibm_init_struct *iibm); | ||
612 | static int light_read(char *p); | ||
613 | static int light_write(char *buf); | ||
614 | |||
615 | |||
616 | /* | ||
617 | * Thermal subdriver | ||
618 | */ | ||
619 | |||
620 | enum thermal_access_mode { | ||
621 | TPACPI_THERMAL_NONE = 0, /* No thermal support */ | ||
622 | TPACPI_THERMAL_ACPI_TMP07, /* Use ACPI TMP0-7 */ | ||
623 | TPACPI_THERMAL_ACPI_UPDT, /* Use ACPI TMP0-7 with UPDT */ | ||
624 | TPACPI_THERMAL_TPEC_8, /* Use ACPI EC regs, 8 sensors */ | ||
625 | TPACPI_THERMAL_TPEC_16, /* Use ACPI EC regs, 16 sensors */ | ||
626 | }; | ||
627 | |||
628 | enum { /* TPACPI_THERMAL_TPEC_* */ | ||
629 | TP_EC_THERMAL_TMP0 = 0x78, /* ACPI EC regs TMP 0..7 */ | ||
630 | TP_EC_THERMAL_TMP8 = 0xC0, /* ACPI EC regs TMP 8..15 */ | ||
631 | TP_EC_THERMAL_TMP_NA = -128, /* ACPI EC sensor not available */ | ||
632 | }; | ||
633 | |||
634 | #define TPACPI_MAX_THERMAL_SENSORS 16 /* Max thermal sensors supported */ | ||
635 | struct ibm_thermal_sensors_struct { | ||
636 | s32 temp[TPACPI_MAX_THERMAL_SENSORS]; | ||
637 | }; | ||
638 | |||
639 | static enum thermal_access_mode thermal_read_mode; | ||
640 | |||
641 | static int thermal_init(struct ibm_init_struct *iibm); | ||
642 | static int thermal_get_sensor(int idx, s32 *value); | ||
643 | static int thermal_get_sensors(struct ibm_thermal_sensors_struct *s); | ||
644 | static int thermal_read(char *p); | ||
645 | |||
646 | |||
647 | /* | ||
648 | * Video subdriver | ||
649 | */ | ||
650 | |||
651 | enum video_access_mode { | ||
652 | TPACPI_VIDEO_NONE = 0, | ||
653 | TPACPI_VIDEO_570, /* 570 */ | ||
654 | TPACPI_VIDEO_770, /* 600e/x, 770e, 770x */ | ||
655 | TPACPI_VIDEO_NEW, /* all others */ | ||
656 | }; | ||
657 | |||
658 | enum { /* video status flags, based on VIDEO_570 */ | ||
659 | TP_ACPI_VIDEO_S_LCD = 0x01, /* LCD output enabled */ | ||
660 | TP_ACPI_VIDEO_S_CRT = 0x02, /* CRT output enabled */ | ||
661 | TP_ACPI_VIDEO_S_DVI = 0x08, /* DVI output enabled */ | ||
662 | }; | ||
663 | |||
664 | enum { /* TPACPI_VIDEO_570 constants */ | ||
665 | TP_ACPI_VIDEO_570_PHSCMD = 0x87, /* unknown magic constant :( */ | ||
666 | TP_ACPI_VIDEO_570_PHSMASK = 0x03, /* PHS bits that map to | ||
667 | * video_status_flags */ | ||
668 | TP_ACPI_VIDEO_570_PHS2CMD = 0x8b, /* unknown magic constant :( */ | ||
669 | TP_ACPI_VIDEO_570_PHS2SET = 0x80, /* unknown magic constant :( */ | ||
670 | }; | ||
671 | |||
672 | static enum video_access_mode video_supported; | ||
673 | static int video_orig_autosw; | ||
674 | static acpi_handle vid_handle, vid2_handle; | ||
675 | |||
676 | static int video_init(struct ibm_init_struct *iibm); | ||
677 | static void video_exit(void); | ||
678 | static int video_outputsw_get(void); | ||
679 | static int video_outputsw_set(int status); | ||
680 | static int video_autosw_get(void); | ||
681 | static int video_autosw_set(int enable); | ||
682 | static int video_outputsw_cycle(void); | ||
683 | static int video_expand_toggle(void); | ||
684 | static int video_read(char *p); | ||
685 | static int video_write(char *buf); | ||
686 | |||
687 | |||
688 | /* | ||
689 | * Volume subdriver | ||
690 | */ | ||
691 | |||
692 | static int volume_offset = 0x30; | ||
693 | |||
694 | static int volume_read(char *p); | ||
695 | static int volume_write(char *buf); | ||
696 | |||
697 | |||
698 | /* | ||
699 | * Wan subdriver | ||
700 | */ | ||
701 | |||
702 | enum { | ||
703 | /* ACPI GWAN/SWAN bits */ | ||
704 | TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ | ||
705 | TP_ACPI_WANCARD_RADIOSSW = 0x02, /* Wan radio enabled */ | ||
706 | TP_ACPI_WANCARD_UNK = 0x04, /* unknown function */ | ||
707 | }; | ||
708 | |||
709 | static int wan_init(struct ibm_init_struct *iibm); | ||
710 | static int wan_get_radiosw(void); | ||
711 | static int wan_set_radiosw(int radio_on); | ||
712 | static int wan_read(char *p); | ||
713 | static int wan_write(char *buf); | ||
714 | |||
715 | /* ==================================================== END HEADER */ | ||
716 | 301 | ||
717 | MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh"); | 302 | MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh"); |
718 | MODULE_DESCRIPTION(IBM_DESC); | 303 | MODULE_DESCRIPTION(IBM_DESC); |
@@ -948,6 +533,10 @@ static int issue_thinkpad_cmos_command(int cmos_cmd) | |||
948 | * ACPI device model | 533 | * ACPI device model |
949 | */ | 534 | */ |
950 | 535 | ||
536 | #define IBM_ACPIHANDLE_INIT(object) \ | ||
537 | drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \ | ||
538 | object##_paths, ARRAY_SIZE(object##_paths), &object##_path) | ||
539 | |||
951 | static void drv_acpi_handle_init(char *name, | 540 | static void drv_acpi_handle_init(char *name, |
952 | acpi_handle *handle, acpi_handle parent, | 541 | acpi_handle *handle, acpi_handle parent, |
953 | char **paths, int num_paths, char **path) | 542 | char **paths, int num_paths, char **path) |
@@ -1298,6 +887,9 @@ static struct attribute_set *create_attr_set(unsigned int max_members, | |||
1298 | return &sobj->s; | 887 | return &sobj->s; |
1299 | } | 888 | } |
1300 | 889 | ||
890 | #define destroy_attr_set(_set) \ | ||
891 | kfree(_set); | ||
892 | |||
1301 | /* not multi-threaded safe, use it in a single thread per set */ | 893 | /* not multi-threaded safe, use it in a single thread per set */ |
1302 | static int add_to_attr_set(struct attribute_set* s, struct attribute *attr) | 894 | static int add_to_attr_set(struct attribute_set* s, struct attribute *attr) |
1303 | { | 895 | { |
@@ -1334,6 +926,9 @@ static void delete_attr_set(struct attribute_set* s, struct kobject *kobj) | |||
1334 | destroy_attr_set(s); | 926 | destroy_attr_set(s); |
1335 | } | 927 | } |
1336 | 928 | ||
929 | #define register_attr_set_with_sysfs(_attr_set, _kobj) \ | ||
930 | sysfs_create_group(_kobj, &_attr_set->group) | ||
931 | |||
1337 | static int parse_strtoul(const char *buf, | 932 | static int parse_strtoul(const char *buf, |
1338 | unsigned long max, unsigned long *value) | 933 | unsigned long max, unsigned long *value) |
1339 | { | 934 | { |
@@ -1403,6 +998,33 @@ static struct ibm_struct thinkpad_acpi_driver_data = { | |||
1403 | * Hotkey subdriver | 998 | * Hotkey subdriver |
1404 | */ | 999 | */ |
1405 | 1000 | ||
1001 | enum { /* hot key scan codes (derived from ACPI DSDT) */ | ||
1002 | TP_ACPI_HOTKEYSCAN_FNF1 = 0, | ||
1003 | TP_ACPI_HOTKEYSCAN_FNF2, | ||
1004 | TP_ACPI_HOTKEYSCAN_FNF3, | ||
1005 | TP_ACPI_HOTKEYSCAN_FNF4, | ||
1006 | TP_ACPI_HOTKEYSCAN_FNF5, | ||
1007 | TP_ACPI_HOTKEYSCAN_FNF6, | ||
1008 | TP_ACPI_HOTKEYSCAN_FNF7, | ||
1009 | TP_ACPI_HOTKEYSCAN_FNF8, | ||
1010 | TP_ACPI_HOTKEYSCAN_FNF9, | ||
1011 | TP_ACPI_HOTKEYSCAN_FNF10, | ||
1012 | TP_ACPI_HOTKEYSCAN_FNF11, | ||
1013 | TP_ACPI_HOTKEYSCAN_FNF12, | ||
1014 | TP_ACPI_HOTKEYSCAN_FNBACKSPACE, | ||
1015 | TP_ACPI_HOTKEYSCAN_FNINSERT, | ||
1016 | TP_ACPI_HOTKEYSCAN_FNDELETE, | ||
1017 | TP_ACPI_HOTKEYSCAN_FNHOME, | ||
1018 | TP_ACPI_HOTKEYSCAN_FNEND, | ||
1019 | TP_ACPI_HOTKEYSCAN_FNPAGEUP, | ||
1020 | TP_ACPI_HOTKEYSCAN_FNPAGEDOWN, | ||
1021 | TP_ACPI_HOTKEYSCAN_FNSPACE, | ||
1022 | TP_ACPI_HOTKEYSCAN_VOLUMEUP, | ||
1023 | TP_ACPI_HOTKEYSCAN_VOLUMEDOWN, | ||
1024 | TP_ACPI_HOTKEYSCAN_MUTE, | ||
1025 | TP_ACPI_HOTKEYSCAN_THINKPAD, | ||
1026 | }; | ||
1027 | |||
1406 | enum { /* Keys available through NVRAM polling */ | 1028 | enum { /* Keys available through NVRAM polling */ |
1407 | TPACPI_HKEY_NVRAM_KNOWN_MASK = 0x00fb88c0U, | 1029 | TPACPI_HKEY_NVRAM_KNOWN_MASK = 0x00fb88c0U, |
1408 | TPACPI_HKEY_NVRAM_GOOD_MASK = 0x00fb8000U, | 1030 | TPACPI_HKEY_NVRAM_GOOD_MASK = 0x00fb8000U, |
@@ -1464,6 +1086,8 @@ static unsigned int hotkey_config_change; | |||
1464 | 1086 | ||
1465 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ | 1087 | #endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ |
1466 | 1088 | ||
1089 | static struct mutex hotkey_mutex; | ||
1090 | |||
1467 | static int hotkey_orig_status; | 1091 | static int hotkey_orig_status; |
1468 | static u32 hotkey_orig_mask; | 1092 | static u32 hotkey_orig_mask; |
1469 | static u32 hotkey_all_mask; | 1093 | static u32 hotkey_all_mask; |
@@ -2635,6 +2259,16 @@ static struct ibm_struct hotkey_driver_data = { | |||
2635 | * Bluetooth subdriver | 2259 | * Bluetooth subdriver |
2636 | */ | 2260 | */ |
2637 | 2261 | ||
2262 | enum { | ||
2263 | /* ACPI GBDC/SBDC bits */ | ||
2264 | TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ | ||
2265 | TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */ | ||
2266 | TP_ACPI_BLUETOOTH_UNK = 0x04, /* unknown function */ | ||
2267 | }; | ||
2268 | |||
2269 | static int bluetooth_get_radiosw(void); | ||
2270 | static int bluetooth_set_radiosw(int radio_on); | ||
2271 | |||
2638 | /* sysfs bluetooth enable ---------------------------------------------- */ | 2272 | /* sysfs bluetooth enable ---------------------------------------------- */ |
2639 | static ssize_t bluetooth_enable_show(struct device *dev, | 2273 | static ssize_t bluetooth_enable_show(struct device *dev, |
2640 | struct device_attribute *attr, | 2274 | struct device_attribute *attr, |
@@ -2799,6 +2433,16 @@ static struct ibm_struct bluetooth_driver_data = { | |||
2799 | * Wan subdriver | 2433 | * Wan subdriver |
2800 | */ | 2434 | */ |
2801 | 2435 | ||
2436 | enum { | ||
2437 | /* ACPI GWAN/SWAN bits */ | ||
2438 | TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ | ||
2439 | TP_ACPI_WANCARD_RADIOSSW = 0x02, /* Wan radio enabled */ | ||
2440 | TP_ACPI_WANCARD_UNK = 0x04, /* unknown function */ | ||
2441 | }; | ||
2442 | |||
2443 | static int wan_get_radiosw(void); | ||
2444 | static int wan_set_radiosw(int radio_on); | ||
2445 | |||
2802 | /* sysfs wan enable ---------------------------------------------------- */ | 2446 | /* sysfs wan enable ---------------------------------------------------- */ |
2803 | static ssize_t wan_enable_show(struct device *dev, | 2447 | static ssize_t wan_enable_show(struct device *dev, |
2804 | struct device_attribute *attr, | 2448 | struct device_attribute *attr, |
@@ -2962,9 +2606,33 @@ static struct ibm_struct wan_driver_data = { | |||
2962 | * Video subdriver | 2606 | * Video subdriver |
2963 | */ | 2607 | */ |
2964 | 2608 | ||
2609 | enum video_access_mode { | ||
2610 | TPACPI_VIDEO_NONE = 0, | ||
2611 | TPACPI_VIDEO_570, /* 570 */ | ||
2612 | TPACPI_VIDEO_770, /* 600e/x, 770e, 770x */ | ||
2613 | TPACPI_VIDEO_NEW, /* all others */ | ||
2614 | }; | ||
2615 | |||
2616 | enum { /* video status flags, based on VIDEO_570 */ | ||
2617 | TP_ACPI_VIDEO_S_LCD = 0x01, /* LCD output enabled */ | ||
2618 | TP_ACPI_VIDEO_S_CRT = 0x02, /* CRT output enabled */ | ||
2619 | TP_ACPI_VIDEO_S_DVI = 0x08, /* DVI output enabled */ | ||
2620 | }; | ||
2621 | |||
2622 | enum { /* TPACPI_VIDEO_570 constants */ | ||
2623 | TP_ACPI_VIDEO_570_PHSCMD = 0x87, /* unknown magic constant :( */ | ||
2624 | TP_ACPI_VIDEO_570_PHSMASK = 0x03, /* PHS bits that map to | ||
2625 | * video_status_flags */ | ||
2626 | TP_ACPI_VIDEO_570_PHS2CMD = 0x8b, /* unknown magic constant :( */ | ||
2627 | TP_ACPI_VIDEO_570_PHS2SET = 0x80, /* unknown magic constant :( */ | ||
2628 | }; | ||
2629 | |||
2965 | static enum video_access_mode video_supported; | 2630 | static enum video_access_mode video_supported; |
2966 | static int video_orig_autosw; | 2631 | static int video_orig_autosw; |
2967 | 2632 | ||
2633 | static int video_autosw_get(void); | ||
2634 | static int video_autosw_set(int enable); | ||
2635 | |||
2968 | IBM_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ | 2636 | IBM_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ |
2969 | "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ | 2637 | "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ |
2970 | "\\_SB.PCI0.VID0", /* 770e */ | 2638 | "\\_SB.PCI0.VID0", /* 770e */ |
@@ -3370,6 +3038,10 @@ static struct ibm_struct light_driver_data = { | |||
3370 | 3038 | ||
3371 | #ifdef CONFIG_THINKPAD_ACPI_DOCK | 3039 | #ifdef CONFIG_THINKPAD_ACPI_DOCK |
3372 | 3040 | ||
3041 | static void dock_notify(struct ibm_struct *ibm, u32 event); | ||
3042 | static int dock_read(char *p); | ||
3043 | static int dock_write(char *buf); | ||
3044 | |||
3373 | IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ | 3045 | IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ |
3374 | "\\_SB.PCI0.DOCK", /* 600e/x,770e,770x,A2xm/p,T20-22,X20-21 */ | 3046 | "\\_SB.PCI0.DOCK", /* 600e/x,770e,770x,A2xm/p,T20-22,X20-21 */ |
3375 | "\\_SB.PCI0.PCI1.DOCK", /* all others */ | 3047 | "\\_SB.PCI0.PCI1.DOCK", /* all others */ |
@@ -3524,6 +3196,7 @@ static int dock_write(char *buf) | |||
3524 | */ | 3196 | */ |
3525 | 3197 | ||
3526 | #ifdef CONFIG_THINKPAD_ACPI_BAY | 3198 | #ifdef CONFIG_THINKPAD_ACPI_BAY |
3199 | |||
3527 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ | 3200 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ |
3528 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ | 3201 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ |
3529 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ | 3202 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ |
@@ -3741,6 +3414,19 @@ static struct ibm_struct cmos_driver_data = { | |||
3741 | * LED subdriver | 3414 | * LED subdriver |
3742 | */ | 3415 | */ |
3743 | 3416 | ||
3417 | enum led_access_mode { | ||
3418 | TPACPI_LED_NONE = 0, | ||
3419 | TPACPI_LED_570, /* 570 */ | ||
3420 | TPACPI_LED_OLD, /* 600e/x, 770e, 770x, A21e, A2xm/p, T20-22, X20-21 */ | ||
3421 | TPACPI_LED_NEW, /* all others */ | ||
3422 | }; | ||
3423 | |||
3424 | enum { /* For TPACPI_LED_OLD */ | ||
3425 | TPACPI_LED_EC_HLCL = 0x0c, /* EC reg to get led to power on */ | ||
3426 | TPACPI_LED_EC_HLBL = 0x0d, /* EC reg to blink a lit led */ | ||
3427 | TPACPI_LED_EC_HLMS = 0x0e, /* EC reg to select led to command */ | ||
3428 | }; | ||
3429 | |||
3744 | static enum led_access_mode led_supported; | 3430 | static enum led_access_mode led_supported; |
3745 | 3431 | ||
3746 | IBM_HANDLE(led, ec, "SLED", /* 570 */ | 3432 | IBM_HANDLE(led, ec, "SLED", /* 570 */ |
@@ -3930,8 +3616,30 @@ static struct ibm_struct beep_driver_data = { | |||
3930 | * Thermal subdriver | 3616 | * Thermal subdriver |
3931 | */ | 3617 | */ |
3932 | 3618 | ||
3619 | enum thermal_access_mode { | ||
3620 | TPACPI_THERMAL_NONE = 0, /* No thermal support */ | ||
3621 | TPACPI_THERMAL_ACPI_TMP07, /* Use ACPI TMP0-7 */ | ||
3622 | TPACPI_THERMAL_ACPI_UPDT, /* Use ACPI TMP0-7 with UPDT */ | ||
3623 | TPACPI_THERMAL_TPEC_8, /* Use ACPI EC regs, 8 sensors */ | ||
3624 | TPACPI_THERMAL_TPEC_16, /* Use ACPI EC regs, 16 sensors */ | ||
3625 | }; | ||
3626 | |||
3627 | enum { /* TPACPI_THERMAL_TPEC_* */ | ||
3628 | TP_EC_THERMAL_TMP0 = 0x78, /* ACPI EC regs TMP 0..7 */ | ||
3629 | TP_EC_THERMAL_TMP8 = 0xC0, /* ACPI EC regs TMP 8..15 */ | ||
3630 | TP_EC_THERMAL_TMP_NA = -128, /* ACPI EC sensor not available */ | ||
3631 | }; | ||
3632 | |||
3633 | #define TPACPI_MAX_THERMAL_SENSORS 16 /* Max thermal sensors supported */ | ||
3634 | struct ibm_thermal_sensors_struct { | ||
3635 | s32 temp[TPACPI_MAX_THERMAL_SENSORS]; | ||
3636 | }; | ||
3637 | |||
3933 | static enum thermal_access_mode thermal_read_mode; | 3638 | static enum thermal_access_mode thermal_read_mode; |
3934 | 3639 | ||
3640 | static int thermal_get_sensor(int idx, s32 *value); | ||
3641 | static int thermal_get_sensors(struct ibm_thermal_sensors_struct *s); | ||
3642 | |||
3935 | /* sysfs temp##_input -------------------------------------------------- */ | 3643 | /* sysfs temp##_input -------------------------------------------------- */ |
3936 | 3644 | ||
3937 | static ssize_t thermal_temp_input_show(struct device *dev, | 3645 | static ssize_t thermal_temp_input_show(struct device *dev, |
@@ -4306,7 +4014,16 @@ static struct ibm_struct ecdump_driver_data = { | |||
4306 | * Backlight/brightness subdriver | 4014 | * Backlight/brightness subdriver |
4307 | */ | 4015 | */ |
4308 | 4016 | ||
4017 | #define TPACPI_BACKLIGHT_DEV_NAME "thinkpad_screen" | ||
4018 | |||
4309 | static struct backlight_device *ibm_backlight_device; | 4019 | static struct backlight_device *ibm_backlight_device; |
4020 | static int brightness_offset = 0x31; | ||
4021 | static int brightness_mode; | ||
4022 | static unsigned int brightness_enable = 2; /* 2 = auto, 0 = no, 1 = yes */ | ||
4023 | |||
4024 | static int brightness_get(struct backlight_device *bd); | ||
4025 | static int brightness_set(int value); | ||
4026 | static int brightness_update_status(struct backlight_device *bd); | ||
4310 | 4027 | ||
4311 | static struct backlight_ops ibm_backlight_data = { | 4028 | static struct backlight_ops ibm_backlight_data = { |
4312 | .get_brightness = brightness_get, | 4029 | .get_brightness = brightness_get, |
@@ -4628,6 +4345,8 @@ static struct ibm_struct brightness_driver_data = { | |||
4628 | * Volume subdriver | 4345 | * Volume subdriver |
4629 | */ | 4346 | */ |
4630 | 4347 | ||
4348 | static int volume_offset = 0x30; | ||
4349 | |||
4631 | static int volume_read(char *p) | 4350 | static int volume_read(char *p) |
4632 | { | 4351 | { |
4633 | int len = 0; | 4352 | int len = 0; |
@@ -4819,15 +4538,59 @@ static struct ibm_struct volume_driver_data = { | |||
4819 | * but the ACPI tables just mention level 7. | 4538 | * but the ACPI tables just mention level 7. |
4820 | */ | 4539 | */ |
4821 | 4540 | ||
4541 | enum { /* Fan control constants */ | ||
4542 | fan_status_offset = 0x2f, /* EC register 0x2f */ | ||
4543 | fan_rpm_offset = 0x84, /* EC register 0x84: LSB, 0x85 MSB (RPM) | ||
4544 | * 0x84 must be read before 0x85 */ | ||
4545 | |||
4546 | TP_EC_FAN_FULLSPEED = 0x40, /* EC fan mode: full speed */ | ||
4547 | TP_EC_FAN_AUTO = 0x80, /* EC fan mode: auto fan control */ | ||
4548 | |||
4549 | TPACPI_FAN_LAST_LEVEL = 0x100, /* Use cached last-seen fan level */ | ||
4550 | }; | ||
4551 | |||
4552 | enum fan_status_access_mode { | ||
4553 | TPACPI_FAN_NONE = 0, /* No fan status or control */ | ||
4554 | TPACPI_FAN_RD_ACPI_GFAN, /* Use ACPI GFAN */ | ||
4555 | TPACPI_FAN_RD_TPEC, /* Use ACPI EC regs 0x2f, 0x84-0x85 */ | ||
4556 | }; | ||
4557 | |||
4558 | enum fan_control_access_mode { | ||
4559 | TPACPI_FAN_WR_NONE = 0, /* No fan control */ | ||
4560 | TPACPI_FAN_WR_ACPI_SFAN, /* Use ACPI SFAN */ | ||
4561 | TPACPI_FAN_WR_TPEC, /* Use ACPI EC reg 0x2f */ | ||
4562 | TPACPI_FAN_WR_ACPI_FANS, /* Use ACPI FANS and EC reg 0x2f */ | ||
4563 | }; | ||
4564 | |||
4565 | enum fan_control_commands { | ||
4566 | TPACPI_FAN_CMD_SPEED = 0x0001, /* speed command */ | ||
4567 | TPACPI_FAN_CMD_LEVEL = 0x0002, /* level command */ | ||
4568 | TPACPI_FAN_CMD_ENABLE = 0x0004, /* enable/disable cmd, | ||
4569 | * and also watchdog cmd */ | ||
4570 | }; | ||
4571 | |||
4572 | static int fan_control_allowed; | ||
4573 | |||
4822 | static enum fan_status_access_mode fan_status_access_mode; | 4574 | static enum fan_status_access_mode fan_status_access_mode; |
4823 | static enum fan_control_access_mode fan_control_access_mode; | 4575 | static enum fan_control_access_mode fan_control_access_mode; |
4824 | static enum fan_control_commands fan_control_commands; | 4576 | static enum fan_control_commands fan_control_commands; |
4825 | 4577 | ||
4826 | static u8 fan_control_initial_status; | 4578 | static u8 fan_control_initial_status; |
4827 | static u8 fan_control_desired_level; | 4579 | static u8 fan_control_desired_level; |
4580 | static int fan_watchdog_maxinterval; | ||
4581 | |||
4582 | static struct mutex fan_mutex; | ||
4828 | 4583 | ||
4584 | static int fan_get_status(u8 *status); | ||
4585 | static int fan_get_status_safe(u8 *status); | ||
4586 | static int fan_get_speed(unsigned int *speed); | ||
4587 | static void fan_update_desired_level(u8 status); | ||
4829 | static void fan_watchdog_fire(struct work_struct *ignored); | 4588 | static void fan_watchdog_fire(struct work_struct *ignored); |
4830 | static int fan_watchdog_maxinterval; | 4589 | static void fan_watchdog_reset(void); |
4590 | static int fan_set_level(int level); | ||
4591 | static int fan_set_level_safe(int level); | ||
4592 | static int fan_set_enable(void); | ||
4593 | |||
4831 | static DECLARE_DELAYED_WORK(fan_watchdog_task, fan_watchdog_fire); | 4594 | static DECLARE_DELAYED_WORK(fan_watchdog_task, fan_watchdog_fire); |
4832 | 4595 | ||
4833 | IBM_HANDLE(fans, ec, "FANS"); /* X31, X40, X41 */ | 4596 | IBM_HANDLE(fans, ec, "FANS"); /* X31, X40, X41 */ |
@@ -5710,9 +5473,6 @@ static struct device_attribute dev_attr_thinkpad_acpi_pdev_name = | |||
5710 | /* /proc support */ | 5473 | /* /proc support */ |
5711 | static struct proc_dir_entry *proc_dir; | 5474 | static struct proc_dir_entry *proc_dir; |
5712 | 5475 | ||
5713 | /* Subdriver registry */ | ||
5714 | static LIST_HEAD(tpacpi_all_drivers); | ||
5715 | |||
5716 | 5476 | ||
5717 | /* | 5477 | /* |
5718 | * Module and infrastructure proble, init and exit handling | 5478 | * Module and infrastructure proble, init and exit handling |
@@ -5727,6 +5487,8 @@ static const char * __init str_supported(int is_supported) | |||
5727 | } | 5487 | } |
5728 | #endif /* CONFIG_THINKPAD_ACPI_DEBUG */ | 5488 | #endif /* CONFIG_THINKPAD_ACPI_DEBUG */ |
5729 | 5489 | ||
5490 | static void ibm_exit(struct ibm_struct *ibm); | ||
5491 | |||
5730 | static int __init ibm_init(struct ibm_init_struct *iibm) | 5492 | static int __init ibm_init(struct ibm_init_struct *iibm) |
5731 | { | 5493 | { |
5732 | int ret; | 5494 | int ret; |
@@ -6042,25 +5804,18 @@ static int __init set_ibm_param(const char *val, struct kernel_param *kp) | |||
6042 | return -EINVAL; | 5804 | return -EINVAL; |
6043 | } | 5805 | } |
6044 | 5806 | ||
6045 | static int experimental; | ||
6046 | module_param(experimental, int, 0); | 5807 | module_param(experimental, int, 0); |
6047 | 5808 | ||
6048 | static u32 dbg_level; | ||
6049 | module_param_named(debug, dbg_level, uint, 0); | 5809 | module_param_named(debug, dbg_level, uint, 0); |
6050 | 5810 | ||
6051 | static int force_load; | ||
6052 | module_param(force_load, bool, 0); | 5811 | module_param(force_load, bool, 0); |
6053 | 5812 | ||
6054 | static int fan_control_allowed; | ||
6055 | module_param_named(fan_control, fan_control_allowed, bool, 0); | 5813 | module_param_named(fan_control, fan_control_allowed, bool, 0); |
6056 | 5814 | ||
6057 | static int brightness_mode; | ||
6058 | module_param_named(brightness_mode, brightness_mode, int, 0); | 5815 | module_param_named(brightness_mode, brightness_mode, int, 0); |
6059 | 5816 | ||
6060 | static unsigned int brightness_enable = 2; /* 2 = auto, 0 = no, 1 = yes */ | ||
6061 | module_param(brightness_enable, uint, 0); | 5817 | module_param(brightness_enable, uint, 0); |
6062 | 5818 | ||
6063 | static unsigned int hotkey_report_mode; | ||
6064 | module_param(hotkey_report_mode, uint, 0); | 5819 | module_param(hotkey_report_mode, uint, 0); |
6065 | 5820 | ||
6066 | #define IBM_PARAM(feature) \ | 5821 | #define IBM_PARAM(feature) \ |
@@ -6084,6 +5839,8 @@ IBM_PARAM(brightness); | |||
6084 | IBM_PARAM(volume); | 5839 | IBM_PARAM(volume); |
6085 | IBM_PARAM(fan); | 5840 | IBM_PARAM(fan); |
6086 | 5841 | ||
5842 | static void thinkpad_acpi_module_exit(void); | ||
5843 | |||
6087 | static int __init thinkpad_acpi_module_init(void) | 5844 | static int __init thinkpad_acpi_module_init(void) |
6088 | { | 5845 | { |
6089 | int ret, i; | 5846 | int ret, i; |