aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lis3lv02d.h
diff options
context:
space:
mode:
authorEric Piel <eric.piel@tremplin-utc.net>2009-01-09 19:41:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-09 19:54:42 -0500
commitcfce41a6d643c001d416ead960caf04fae2d609a (patch)
tree9a80d781c2387c2ad59e5d31ca1fdd7408d0ef89 /drivers/hwmon/lis3lv02d.h
parent8e961870bb9804110d5c8211d5d9d500451c4518 (diff)
LIS3LV02D: separate the core from HP ACPI API
The sensor can be accessed via various buses. In particular, SPI, I²C and, on HP laptops, via a specific ACPI API (the only one currently supported). Separate this latest platform from the core of the sensor driver to allow support for the other bus type. The second, and more direct goal is actually to be able to merge this part with the hp-disk-leds driver, which has the same ACPI PNP number. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/lis3lv02d.h')
-rw-r--r--drivers/hwmon/lis3lv02d.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/hwmon/lis3lv02d.h b/drivers/hwmon/lis3lv02d.h
index 330cfc60e948..223f1c0763bb 100644
--- a/drivers/hwmon/lis3lv02d.h
+++ b/drivers/hwmon/lis3lv02d.h
@@ -23,7 +23,7 @@
23 * The actual chip is STMicroelectronics LIS3LV02DL or LIS3LV02DQ that seems to 23 * The actual chip is STMicroelectronics LIS3LV02DL or LIS3LV02DQ that seems to
24 * be connected via SPI. There exists also several similar chips (such as LIS302DL or 24 * be connected via SPI. There exists also several similar chips (such as LIS302DL or
25 * LIS3L02DQ) but not in the HP laptops and they have slightly different registers. 25 * LIS3L02DQ) but not in the HP laptops and they have slightly different registers.
26 * They can also be connected via I²C. 26 * They can also be connected via I²C.
27 */ 27 */
28 28
29#define LIS3LV02DL_ID 0x3A /* Also the LIS3LV02DQ */ 29#define LIS3LV02DL_ID 0x3A /* Also the LIS3LV02DQ */
@@ -147,3 +147,36 @@ enum lis3lv02d_dd_src {
147 DD_SRC_IA = 0x40, 147 DD_SRC_IA = 0x40,
148}; 148};
149 149
150struct axis_conversion {
151 s8 x;
152 s8 y;
153 s8 z;
154};
155
156struct acpi_lis3lv02d {
157 struct acpi_device *device; /* The ACPI device */
158 acpi_status (*init) (acpi_handle handle);
159 acpi_status (*write) (acpi_handle handle, int reg, u8 val);
160 acpi_status (*read) (acpi_handle handle, int reg, u8 *ret);
161
162 struct input_dev *idev; /* input device */
163 struct task_struct *kthread; /* kthread for input */
164 struct mutex lock;
165 struct platform_device *pdev; /* platform device */
166 atomic_t count; /* interrupt count after last read */
167 int xcalib; /* calibrated null value for x */
168 int ycalib; /* calibrated null value for y */
169 int zcalib; /* calibrated null value for z */
170 unsigned char is_on; /* whether the device is on or off */
171 unsigned char usage; /* usage counter */
172 struct axis_conversion ac; /* hw -> logical axis */
173};
174
175int lis3lv02d_init_device(struct acpi_lis3lv02d *dev);
176int lis3lv02d_joystick_enable(void);
177void lis3lv02d_joystick_disable(void);
178void lis3lv02d_poweroff(acpi_handle handle);
179void lis3lv02d_poweron(acpi_handle handle);
180int lis3lv02d_remove_fs(void);
181
182extern struct acpi_lis3lv02d adev;