Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9229
b: refs/heads/master
c: 4c87b74
h: refs/heads/master
i:
  9227: ec6a2a4
v: v3
  • Loading branch information
Robert Love authored and Linus Torvalds committed Sep 23, 2005
1 parent 62a08d2 commit cff2f3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 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: 609725f87709724218047a1049913ed233f79d3c
refs/heads/master: 4c87b74c72d42f7272aa4bf8f17c73bb53774eee
9 changes: 4 additions & 5 deletions trunk/drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,11 @@ config SENSORS_HDAPS
help
This driver provides support for the IBM Hard Drive Active Protection
System (hdaps), which provides an accelerometer and other misc. data.
Supported laptops include the IBM ThinkPad T41, T42, T43, and R51.
The accelerometer data is readable via sysfs.
ThinkPads starting with the R50, T41, and X40 are supported. The
accelerometer data is readable via sysfs.

This driver also provides an input class device, allowing the
laptop to act as a pinball machine-esque mouse. This is off by
default but enabled via sysfs or the module parameter "mousedev".
This driver also provides an absolute input class device, allowing
the laptop to act as a pinball machine-esque joystick.

Say Y here if you have an applicable laptop and want to experience
the awesome power of hdaps.
Expand Down
21 changes: 9 additions & 12 deletions trunk/drivers/hwmon/hdaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* Copyright (C) 2005 Robert Love <rml@novell.com>
* Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com>
*
* The HardDisk Active Protection System (hdaps) is present in the IBM ThinkPad
* T41, T42, T43, R50, R50p, R51, and X40, at least. It provides a basic
* two-axis accelerometer and other data, such as the device's temperature.
* The HardDisk Active Protection System (hdaps) is present in IBM ThinkPads
* starting with the R40, T41, and X40. It provides a basic two-axis
* accelerometer and other data, such as the device's temperature.
*
* This driver is based on the document by Mark A. Smith available at
* http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html and a lot of trial
Expand Down Expand Up @@ -487,24 +487,19 @@ static struct attribute_group hdaps_attribute_group = {

/* Module stuff */

/*
* XXX: We should be able to return nonzero and halt the detection process.
* But there is a bug in dmi_check_system() where a nonzero return from the
* first match will result in a return of failure from dmi_check_system().
* I fixed this; the patch is 2.6-git. Once in a released tree, we can make
* hdaps_dmi_match_invert() return hdaps_dmi_match(), which in turn returns 1.
*/
/* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
static int hdaps_dmi_match(struct dmi_system_id *id)
{
printk(KERN_INFO "hdaps: %s detected.\n", id->ident);
return 0;
return 1;
}

/* hdaps_dmi_match_invert - found an inverted match. */
static int hdaps_dmi_match_invert(struct dmi_system_id *id)
{
hdaps_invert = 1;
printk(KERN_INFO "hdaps: inverting axis readings.\n");
return 0;
return hdaps_dmi_match(id);
}

#define HDAPS_DMI_MATCH_NORMAL(model) { \
Expand Down Expand Up @@ -534,13 +529,15 @@ static int __init hdaps_init(void)
HDAPS_DMI_MATCH_INVERT("ThinkPad R50p"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad R50"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad R51"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad R52"),
HDAPS_DMI_MATCH_INVERT("ThinkPad T41p"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad T41"),
HDAPS_DMI_MATCH_INVERT("ThinkPad T42p"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad T42"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad T43"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad X40"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad X41 Tablet"),
HDAPS_DMI_MATCH_NORMAL("ThinkPad X41"),
{ .ident = NULL }
};

Expand Down

0 comments on commit cff2f3f

Please sign in to comment.