diff options
Diffstat (limited to 'drivers/hwmon/lis3lv02d.h')
-rw-r--r-- | drivers/hwmon/lis3lv02d.h | 35 |
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 | ||
150 | struct axis_conversion { | ||
151 | s8 x; | ||
152 | s8 y; | ||
153 | s8 z; | ||
154 | }; | ||
155 | |||
156 | struct 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 | |||
175 | int lis3lv02d_init_device(struct acpi_lis3lv02d *dev); | ||
176 | int lis3lv02d_joystick_enable(void); | ||
177 | void lis3lv02d_joystick_disable(void); | ||
178 | void lis3lv02d_poweroff(acpi_handle handle); | ||
179 | void lis3lv02d_poweron(acpi_handle handle); | ||
180 | int lis3lv02d_remove_fs(void); | ||
181 | |||
182 | extern struct acpi_lis3lv02d adev; | ||