1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include <linux/input.h>
7 #include <linux/kthread.h>
8 #include <linux/mutex.h>
9 #include <linux/platform_device.h>
10 #include <linux/spinlock.h>
11 #include <linux/types.h>
12 #include <linux/of_device.h>
15 AMS_IRQ_FREEFALL = 0x01,
17 AMS_IRQ_GLOBAL = 0x04,
29 /* General properties */
30 struct device_node *of_node;
31 struct platform_device *of_dev;
37 /* Interrupt worker */
38 struct work_struct worker;
43 * Only call these functions with the main lock held.
47 void (*get_xyz)(s8 *x, s8 *y, s8 *z);
48 u8 (*get_vendor)(void);
50 void (*clear_irq)(enum ams_irq reg);
52 #ifdef CONFIG_SENSORS_AMS_I2C
54 struct i2c_client *i2c_client;
57 /* Joystick emulation */
58 struct input_dev *idev;
61 /* calibrated null values */
62 int xcalib, ycalib, zcalib;
65 extern struct ams ams_info;
67 extern void ams_sensors(s8 *x, s8 *y, s8 *z);
68 extern int ams_sensor_attach(void);
69 extern void ams_sensor_detach(void);
71 extern int ams_pmu_init(struct device_node *np);
72 extern int ams_i2c_init(struct device_node *np);
74 extern int ams_input_init(void);
75 extern void ams_input_exit(void);