aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRobert Love <rml@novell.com>2005-09-23 00:44:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-23 01:17:34 -0400
commit4c87b74c72d42f7272aa4bf8f17c73bb53774eee (patch)
tree0547b7d7d9f0fc8b271fdf22a5d78617bc8e4bca /drivers
parent609725f87709724218047a1049913ed233f79d3c (diff)
[PATCH] hdaps: small update.
- Handle dmi_system_check() elegantly, now that my bugfix is upstream. - Add support for the X41 and R52. - Cleanup some comments do I do not have to keep updating them with each new whitelisted laptop. Signed-off-by: Robert Love <rml@novell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/Kconfig9
-rw-r--r--drivers/hwmon/hdaps.c21
2 files changed, 13 insertions, 17 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 7e72e922b41c..db358cfa7cbf 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -418,12 +418,11 @@ config SENSORS_HDAPS
418 help 418 help
419 This driver provides support for the IBM Hard Drive Active Protection 419 This driver provides support for the IBM Hard Drive Active Protection
420 System (hdaps), which provides an accelerometer and other misc. data. 420 System (hdaps), which provides an accelerometer and other misc. data.
421 Supported laptops include the IBM ThinkPad T41, T42, T43, and R51. 421 ThinkPads starting with the R50, T41, and X40 are supported. The
422 The accelerometer data is readable via sysfs. 422 accelerometer data is readable via sysfs.
423 423
424 This driver also provides an input class device, allowing the 424 This driver also provides an absolute input class device, allowing
425 laptop to act as a pinball machine-esque mouse. This is off by 425 the laptop to act as a pinball machine-esque joystick.
426 default but enabled via sysfs or the module parameter "mousedev".
427 426
428 Say Y here if you have an applicable laptop and want to experience 427 Say Y here if you have an applicable laptop and want to experience
429 the awesome power of hdaps. 428 the awesome power of hdaps.
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c
index 4c56411f3993..7f0107613827 100644
--- a/drivers/hwmon/hdaps.c
+++ b/drivers/hwmon/hdaps.c
@@ -4,9 +4,9 @@
4 * Copyright (C) 2005 Robert Love <rml@novell.com> 4 * Copyright (C) 2005 Robert Love <rml@novell.com>
5 * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> 5 * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com>
6 * 6 *
7 * The HardDisk Active Protection System (hdaps) is present in the IBM ThinkPad 7 * The HardDisk Active Protection System (hdaps) is present in IBM ThinkPads
8 * T41, T42, T43, R50, R50p, R51, and X40, at least. It provides a basic 8 * starting with the R40, T41, and X40. It provides a basic two-axis
9 * two-axis accelerometer and other data, such as the device's temperature. 9 * accelerometer and other data, such as the device's temperature.
10 * 10 *
11 * This driver is based on the document by Mark A. Smith available at 11 * This driver is based on the document by Mark A. Smith available at
12 * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html and a lot of trial 12 * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html and a lot of trial
@@ -487,24 +487,19 @@ static struct attribute_group hdaps_attribute_group = {
487 487
488/* Module stuff */ 488/* Module stuff */
489 489
490/* 490/* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
491 * XXX: We should be able to return nonzero and halt the detection process.
492 * But there is a bug in dmi_check_system() where a nonzero return from the
493 * first match will result in a return of failure from dmi_check_system().
494 * I fixed this; the patch is 2.6-git. Once in a released tree, we can make
495 * hdaps_dmi_match_invert() return hdaps_dmi_match(), which in turn returns 1.
496 */
497static int hdaps_dmi_match(struct dmi_system_id *id) 491static int hdaps_dmi_match(struct dmi_system_id *id)
498{ 492{
499 printk(KERN_INFO "hdaps: %s detected.\n", id->ident); 493 printk(KERN_INFO "hdaps: %s detected.\n", id->ident);
500 return 0; 494 return 1;
501} 495}
502 496
497/* hdaps_dmi_match_invert - found an inverted match. */
503static int hdaps_dmi_match_invert(struct dmi_system_id *id) 498static int hdaps_dmi_match_invert(struct dmi_system_id *id)
504{ 499{
505 hdaps_invert = 1; 500 hdaps_invert = 1;
506 printk(KERN_INFO "hdaps: inverting axis readings.\n"); 501 printk(KERN_INFO "hdaps: inverting axis readings.\n");
507 return 0; 502 return hdaps_dmi_match(id);
508} 503}
509 504
510#define HDAPS_DMI_MATCH_NORMAL(model) { \ 505#define HDAPS_DMI_MATCH_NORMAL(model) { \
@@ -534,6 +529,7 @@ static int __init hdaps_init(void)
534 HDAPS_DMI_MATCH_INVERT("ThinkPad R50p"), 529 HDAPS_DMI_MATCH_INVERT("ThinkPad R50p"),
535 HDAPS_DMI_MATCH_NORMAL("ThinkPad R50"), 530 HDAPS_DMI_MATCH_NORMAL("ThinkPad R50"),
536 HDAPS_DMI_MATCH_NORMAL("ThinkPad R51"), 531 HDAPS_DMI_MATCH_NORMAL("ThinkPad R51"),
532 HDAPS_DMI_MATCH_NORMAL("ThinkPad R52"),
537 HDAPS_DMI_MATCH_INVERT("ThinkPad T41p"), 533 HDAPS_DMI_MATCH_INVERT("ThinkPad T41p"),
538 HDAPS_DMI_MATCH_NORMAL("ThinkPad T41"), 534 HDAPS_DMI_MATCH_NORMAL("ThinkPad T41"),
539 HDAPS_DMI_MATCH_INVERT("ThinkPad T42p"), 535 HDAPS_DMI_MATCH_INVERT("ThinkPad T42p"),
@@ -541,6 +537,7 @@ static int __init hdaps_init(void)
541 HDAPS_DMI_MATCH_NORMAL("ThinkPad T43"), 537 HDAPS_DMI_MATCH_NORMAL("ThinkPad T43"),
542 HDAPS_DMI_MATCH_NORMAL("ThinkPad X40"), 538 HDAPS_DMI_MATCH_NORMAL("ThinkPad X40"),
543 HDAPS_DMI_MATCH_NORMAL("ThinkPad X41 Tablet"), 539 HDAPS_DMI_MATCH_NORMAL("ThinkPad X41 Tablet"),
540 HDAPS_DMI_MATCH_NORMAL("ThinkPad X41"),
544 { .ident = NULL } 541 { .ident = NULL }
545 }; 542 };
546 543