2 #include <linux/input-polldev.h>
3 #include <linux/kthread.h>
4 #include <linux/mutex.h>
5 #include <linux/spinlock.h>
6 #include <linux/types.h>
7 #include <asm/of_device.h>
10 AMS_IRQ_FREEFALL = 0x01,
12 AMS_IRQ_GLOBAL = 0x04,
24 /* General properties */
25 struct device_node *of_node;
26 struct of_device *of_dev;
32 /* Interrupt worker */
33 struct work_struct worker;
38 * Only call these functions with the main lock held.
42 void (*get_xyz)(s8 *x, s8 *y, s8 *z);
43 u8 (*get_vendor)(void);
45 void (*clear_irq)(enum ams_irq reg);
47 #ifdef CONFIG_SENSORS_AMS_I2C
51 struct i2c_client i2c_client;
54 /* Joystick emulation */
55 struct input_polled_dev *idev;
58 /* calibrated null values */
59 int xcalib, ycalib, zcalib;
62 extern struct ams ams_info;
64 extern void ams_sensors(s8 *x, s8 *y, s8 *z);
65 extern int ams_sensor_attach(void);
67 extern int ams_pmu_init(struct device_node *np);
68 extern int ams_i2c_init(struct device_node *np);
70 extern int ams_input_init(void);
71 extern void ams_input_exit(void);