aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lis3lv02d.h
diff options
context:
space:
mode:
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;