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/spinlock.h>
10 #include <linux/types.h>
13 AMS_IRQ_FREEFALL = 0x01,
15 AMS_IRQ_GLOBAL = 0x04,
27 /* General properties */
28 struct device_node *of_node;
29 struct platform_device *of_dev;
35 /* Interrupt worker */
36 struct work_struct worker;
41 * Only call these functions with the main lock held.
45 void (*get_xyz)(s8 *x, s8 *y, s8 *z);
46 u8 (*get_vendor)(void);
48 void (*clear_irq)(enum ams_irq reg);
50 #ifdef CONFIG_SENSORS_AMS_I2C
52 struct i2c_client *i2c_client;
55 /* Joystick emulation */
56 struct input_dev *idev;
59 /* calibrated null values */
60 int xcalib, ycalib, zcalib;
63 extern struct ams ams_info;
65 extern void ams_sensors(s8 *x, s8 *y, s8 *z);
66 extern int ams_sensor_attach(void);
67 extern void ams_sensor_detach(void);
69 extern int ams_pmu_init(struct device_node *np);
70 extern int ams_i2c_init(struct device_node *np);
72 extern int ams_input_init(void);
73 extern void ams_input_exit(void);